Feature: support code completion (#3612)

This commit is contained in:
woodx
2025-03-17 09:26:19 +08:00
committed by GitHub
parent 9b8333d992
commit 48efec7b05
6 changed files with 266 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ class ServerArgs:
device: Optional[str] = None
served_model_name: Optional[str] = None
chat_template: Optional[str] = None
completion_template: Optional[str] = None
is_embedding: bool = False
revision: Optional[str] = None
@@ -456,6 +457,12 @@ class ServerArgs:
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(
"--completion-template",
type=str,
default=ServerArgs.completion_template,
help="The buliltin completion template name or the path of the completion template file. This is only used for OpenAI-compatible API server. only for code completion currently.",
)
parser.add_argument(
"--is-embedding",
action="store_true",