[webui] support other hub (#8567)

This commit is contained in:
Yaowei Zheng
2025-07-07 22:18:48 +08:00
committed by GitHub
parent 4b0ec83928
commit 12ed792db9
9 changed files with 125 additions and 22 deletions

View File

@@ -38,6 +38,15 @@ if is_gradio_available():
import gradio as gr
def switch_hub(hub_name: str) -> None:
r"""Switch model hub.
Inputs: top.hub_name
"""
os.environ["USE_MODELSCOPE_HUB"] = "1" if hub_name == "modelscope" else "0"
os.environ["USE_OPENMIND_HUB"] = "1" if hub_name == "openmind" else "0"
def can_quantize(finetuning_type: str) -> "gr.Dropdown":
r"""Judge if the quantization is available in this finetuning type.