fix #595
This commit is contained in:
parent
1968d9d1d0
commit
5c052836a0
|
@ -59,7 +59,7 @@ def create_web_demo() -> gr.Blocks:
|
|||
chat_model = WebChatModel(lazy_init=False)
|
||||
|
||||
with gr.Blocks(title="Web Demo", css=CSS) as demo:
|
||||
lang = gr.Dropdown(choices=["en", "zh"])
|
||||
lang = gr.Dropdown(choices=["en", "zh"], value="en")
|
||||
|
||||
_, _, _, chat_elems = create_chat_box(chat_model, visible=True)
|
||||
|
||||
|
|
|
@ -19,14 +19,15 @@ class Manager:
|
|||
}
|
||||
|
||||
user_config = load_config()
|
||||
refresh_dict = {}
|
||||
if not lang:
|
||||
if user_config.get("lang", None):
|
||||
lang = user_config["lang"]
|
||||
else:
|
||||
lang = "en"
|
||||
|
||||
if "lang" in user_config:
|
||||
refresh_dict["lang"] = {"value": user_config["lang"]}
|
||||
else:
|
||||
refresh_dict["lang"] = {"value": "en"}
|
||||
refresh_dict["lang"] = {"value": lang}
|
||||
|
||||
if user_config.get("last_model"):
|
||||
if user_config.get("last_model", None):
|
||||
refresh_dict["model_name"] = {"value": user_config["last_model"]}
|
||||
refresh_dict["model_path"] = {"value": get_model_path(user_config["last_model"])}
|
||||
|
||||
|
|
Loading…
Reference in New Issue