From a475aa7816a1e21750410eabbe2413259ea0e593 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:39:08 -0800 Subject: [PATCH] Improve API documentation --- extensions/openai/script.py | 4 ++++ extensions/openai/typing.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/openai/script.py b/extensions/openai/script.py index c7f61abe..f799f970 100644 --- a/extensions/openai/script.py +++ b/extensions/openai/script.py @@ -261,10 +261,12 @@ async def handle_load_model(request_data: LoadModelRequest): The "args" parameter can be used to modify flags like "--load-in-4bit" or "--n-gpu-layers" before loading a model. Example: + ``` "args": { "load_in_4bit": true, "n_gpu_layers": 12 } + ``` Note that those settings will remain after loading the model. So you may need to change them back to load a second model. @@ -273,9 +275,11 @@ async def handle_load_model(request_data: LoadModelRequest): shared.settings object. It can be used to modify the default instruction template like this: + ``` "settings": { "instruction_template": "Alpaca" } + ``` ''' try: diff --git a/extensions/openai/typing.py b/extensions/openai/typing.py index 8b2938df..ee8f2ac6 100644 --- a/extensions/openai/typing.py +++ b/extensions/openai/typing.py @@ -99,7 +99,7 @@ class ChatCompletionRequestParams(BaseModel): system_message: str | None = Field(default=None, description="Overwrites the value set by instruction_template.") character: str | None = Field(default=None, description="A character defined under text-generation-webui/characters. If not set, the default \"Assistant\" character will be used.") - name1: str | None = Field(default=None, description="Overwrites the value set by character.") + name1: str | None = Field(default=None, description="Your name (the user). By default, it's \"You\".") name2: str | None = Field(default=None, description="Overwrites the value set by character.") context: str | None = Field(default=None, description="Overwrites the value set by character.") greeting: str | None = Field(default=None, description="Overwrites the value set by character.")