upgrade gradio to 4.21.0

This commit is contained in:
hiyouga
2024-03-30 20:37:08 +08:00
parent a0333bb0ce
commit 831c5321ac
18 changed files with 167 additions and 159 deletions

View File

@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Dict, Tuple
from typing import TYPE_CHECKING, Dict
import gradio as gr
@@ -12,7 +12,7 @@ if TYPE_CHECKING:
from gradio.components import Component
def create_top() -> Tuple["gr.Dropdown", Dict[str, "Component"]]:
def create_top() -> Dict[str, "Component"]:
available_models = list(SUPPORTED_MODELS.keys()) + ["Custom"]
with gr.Row():
@@ -25,7 +25,7 @@ def create_top() -> Tuple["gr.Dropdown", Dict[str, "Component"]]:
adapter_path = gr.Dropdown(multiselect=True, allow_custom_value=True, scale=5)
refresh_btn = gr.Button(scale=1)
with gr.Accordion(label="Advanced config", open=False) as advanced_tab:
with gr.Accordion(open=False) as advanced_tab:
with gr.Row():
quantization_bit = gr.Dropdown(choices=["none", "8", "4"], value="none")
template = gr.Dropdown(choices=list(templates.keys()), value="default")
@@ -44,7 +44,7 @@ def create_top() -> Tuple["gr.Dropdown", Dict[str, "Component"]]:
refresh_btn.click(list_adapters, [model_name, finetuning_type], [adapter_path], queue=False)
return lang, dict(
return dict(
lang=lang,
model_name=model_name,
model_path=model_path,