mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 20:52:59 +08:00
fix web ui demo
Former-commit-id: 10ce87e088ae5934c4c3e61e9d0556cd5378308c
This commit is contained in:
parent
be0fb659d2
commit
8454e02313
@ -29,14 +29,14 @@ class WebChatModel(ChatModel):
|
|||||||
if not lazy_init: # read arguments from command line
|
if not lazy_init: # read arguments from command line
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
if demo_mode: # load config.json by default
|
if demo_mode: # load demo_config.json if exists
|
||||||
import json
|
import json
|
||||||
try:
|
try:
|
||||||
with open("demo_config.json", "r", encoding="utf-8") as f:
|
with open("demo_config.json", "r", encoding="utf-8") as f:
|
||||||
args = json.load(f)
|
args = json.load(f)
|
||||||
|
super().__init__(args)
|
||||||
except:
|
except:
|
||||||
raise ValueError("Cannot find `demo_config.json` at current directory.")
|
print("Cannot find `demo_config.json` at current directory.")
|
||||||
super().__init__(args)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def loaded(self) -> bool:
|
def loaded(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user