server : clean up built-in template detection (#11026)

* server : clean up built-in template detection

* fix compilation

* add chat template test

* fix condition
This commit is contained in:
Xuan Son Nguyen 2024-12-31 15:22:01 +01:00 committed by GitHub
parent 5896c65232
commit 45095a61bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 44 additions and 27 deletions

View file

@ -74,6 +74,7 @@ class ServerProcess:
draft_min: int | None = None
draft_max: int | None = None
no_webui: bool | None = None
chat_template: str | None = None
# session variables
process: subprocess.Popen | None = None
@ -164,6 +165,8 @@ class ServerProcess:
server_args.extend(["--draft-min", self.draft_min])
if self.no_webui:
server_args.append("--no-webui")
if self.chat_template:
server_args.extend(["--chat-template", self.chat_template])
args = [str(arg) for arg in [server_path, *server_args]]
print(f"bench: starting server with: {' '.join(args)}")