mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 15:52:49 +08:00
fix webui
Former-commit-id: cf4cd52d36894f53a6ec45d003f887771012e5b4
This commit is contained in:
parent
8e26eb374e
commit
0b8e19b6a6
@ -58,7 +58,7 @@ def create_sft_tab(top_elems: Dict[str, "Component"], runner: "Runner") -> Dict[
|
|||||||
stop_btn = gr.Button()
|
stop_btn = gr.Button()
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
with gr.Column(scale=4):
|
with gr.Column(scale=3):
|
||||||
output_dir = gr.Textbox()
|
output_dir = gr.Textbox()
|
||||||
|
|
||||||
with gr.Box():
|
with gr.Box():
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
import gradio as gr
|
import gradio as gr
|
||||||
from typing import TYPE_CHECKING, Any, Dict, List
|
from gradio.components import Component
|
||||||
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
from llmtuner.webui.common import get_model_path, list_dataset, load_config
|
from llmtuner.webui.common import get_model_path, list_dataset, load_config
|
||||||
from llmtuner.webui.locales import LOCALES
|
from llmtuner.webui.locales import LOCALES
|
||||||
from llmtuner.webui.utils import get_time
|
from llmtuner.webui.utils import get_time
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from gradio.components import Component
|
|
||||||
|
|
||||||
|
|
||||||
class Manager:
|
class Manager:
|
||||||
|
|
||||||
def __init__(self, elem_list: List[Dict[str, "Component"]]):
|
def __init__(self, elem_list: List[Dict[str, Component]]):
|
||||||
self.elem_list = elem_list
|
self.elem_list = elem_list
|
||||||
|
|
||||||
def gen_refresh(self) -> Dict[str, Any]:
|
def gen_refresh(self) -> Dict[str, Any]:
|
||||||
@ -26,7 +24,7 @@ class Manager:
|
|||||||
|
|
||||||
return refresh_dict
|
return refresh_dict
|
||||||
|
|
||||||
def gen_label(self, lang: str) -> Dict["Component", dict]:
|
def gen_label(self, lang: str) -> Dict[Component, Dict[str, Any]]: # cannot use TYPE_CHECKING
|
||||||
update_dict = {}
|
update_dict = {}
|
||||||
refresh_dict = self.gen_refresh()
|
refresh_dict = self.gen_refresh()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user