Skip to content

Commit 0b8e19b

Browse files
committed
fix webui
Former-commit-id: cf4cd52d36894f53a6ec45d003f887771012e5b4
1 parent 8e26eb3 commit 0b8e19b

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/llmtuner/webui/components/sft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def create_sft_tab(top_elems: Dict[str, "Component"], runner: "Runner") -> Dict[
5858
stop_btn = gr.Button()
5959

6060
with gr.Row():
61-
with gr.Column(scale=4):
61+
with gr.Column(scale=3):
6262
output_dir = gr.Textbox()
6363

6464
with gr.Box():

src/llmtuner/webui/manager.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import gradio as gr
2-
from typing import TYPE_CHECKING, Any, Dict, List
2+
from gradio.components import Component
3+
from typing import Any, Dict, List
34

45
from llmtuner.webui.common import get_model_path, list_dataset, load_config
56
from llmtuner.webui.locales import LOCALES
67
from llmtuner.webui.utils import get_time
78

8-
if TYPE_CHECKING:
9-
from gradio.components import Component
10-
119

1210
class Manager:
1311

14-
def __init__(self, elem_list: List[Dict[str, "Component"]]):
12+
def __init__(self, elem_list: List[Dict[str, Component]]):
1513
self.elem_list = elem_list
1614

1715
def gen_refresh(self) -> Dict[str, Any]:
@@ -26,7 +24,7 @@ def gen_refresh(self) -> Dict[str, Any]:
2624

2725
return refresh_dict
2826

29-
def gen_label(self, lang: str) -> Dict["Component", dict]:
27+
def gen_label(self, lang: str) -> Dict[Component, Dict[str, Any]]: # cannot use TYPE_CHECKING
3028
update_dict = {}
3129
refresh_dict = self.gen_refresh()
3230

0 commit comments

Comments
 (0)