add demo mode for web UI

Former-commit-id: 5ad34f08b4e1505d7933b973497347f126b2e818
This commit is contained in:
hiyouga
2023-11-15 23:51:26 +08:00
parent 2162c37e41
commit 8263b2d32d
10 changed files with 185 additions and 19 deletions

View File

@@ -70,7 +70,7 @@ def get_module(model_name: str) -> str:
def get_template(model_name: str) -> str:
if model_name.endswith("Chat") and get_prefix(model_name) in DEFAULT_TEMPLATE:
if model_name and model_name.endswith("Chat") and get_prefix(model_name) in DEFAULT_TEMPLATE:
return DEFAULT_TEMPLATE[get_prefix(model_name)]
return "default"