This commit is contained in:
hiyouga 2023-08-20 16:40:00 +08:00
parent 1968d9d1d0
commit 5c052836a0
2 changed files with 8 additions and 7 deletions

View File

@ -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)

View File

@ -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"])}