[webui] fix elems (#8587)

This commit is contained in:
Yaowei Zheng 2025-07-08 21:16:42 +08:00 committed by GitHub
parent 766884fa5c
commit cf1087d409
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,15 +50,12 @@ class Engine:
r"""Get the initial value of gradio components and restores training status if necessary."""
user_config = load_config() if not self.demo_mode else {} # do not use config in demo mode
lang = user_config.get("lang") or "en"
hub_name = user_config.get("hub_name") or "huggingface"
init_dict = {
"top.lang": {"value": lang},
"top.hub_name": {"value": hub_name},
"infer.chat_box": {"visible": self.chatter.loaded},
}
init_dict = {"top.lang": {"value": lang}, "infer.chat_box": {"visible": self.chatter.loaded}}
if not self.pure_chat:
current_time = get_time()
hub_name = user_config.get("hub_name") or "huggingface"
init_dict["top.hub_name"] = {"value": hub_name}
init_dict["train.current_time"] = {"value": current_time}
init_dict["train.output_dir"] = {"value": f"train_{current_time}"}
init_dict["train.config_path"] = {"value": f"{current_time}.yaml"}