add webui backend option

Former-commit-id: 3764586cb3ed64fe376d0ae420ff5690c28459e2
This commit is contained in:
hiyouga 2024-04-25 20:49:23 +08:00
parent 7bfbcb1fe3
commit 29eebef696

View File

@ -31,7 +31,10 @@ class WebChatModel(ChatModel):
if demo_mode and os.environ.get("DEMO_MODEL") and os.environ.get("DEMO_TEMPLATE"): # load demo model if demo_mode and os.environ.get("DEMO_MODEL") and os.environ.get("DEMO_TEMPLATE"): # load demo model
model_name_or_path = os.environ.get("DEMO_MODEL") model_name_or_path = os.environ.get("DEMO_MODEL")
template = os.environ.get("DEMO_TEMPLATE") template = os.environ.get("DEMO_TEMPLATE")
super().__init__(dict(model_name_or_path=model_name_or_path, template=template)) infer_backend = os.environ.get("DEMO_BACKEND", "huggingface")
super().__init__(
dict(model_name_or_path=model_name_or_path, template=template, infer_backend=infer_backend)
)
@property @property
def loaded(self) -> bool: def loaded(self) -> bool: