Support v1/chat/completions (#50)

This commit is contained in:
Cody Yu
2024-01-18 23:43:09 -08:00
committed by GitHub
parent 61d4c93962
commit 23471f9aa3
6 changed files with 705 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ class ServerArgs:
port: int = 30000
load_format: str = "auto"
tokenizer_mode: str = "auto"
chat_template: Optional[str] = None
trust_remote_code: bool = True
mem_fraction_static: Optional[float] = None
tp_size: int = 1
@@ -77,6 +78,12 @@ class ServerArgs:
"tokenizer if available, and 'slow' will "
"always use the slow tokenizer.",
)
parser.add_argument(
"--chat-template",
type=str,
default=ServerArgs.chat_template,
help="The buliltin chat template name or the path of the chat template file. This is only used for OpenAI-compatible API server",
)
parser.add_argument(
"--trust-remote-code",
action="store_true",