This commit is contained in:
hailin 2025-07-08 09:53:46 +08:00
parent 3a377925b1
commit 35c0f5b345
1 changed files with 19 additions and 17 deletions

View File

@ -1,7 +1,6 @@
import gradio as gr import gradio as gr
def run_eval(inputs, native, other, outputs): def run_eval(inputs, native, other, outputs):
# 模拟输出,实际应拼接指令后调用 subprocess.run 或远程 API
result = ( result = (
f"\n[Eval Started]\n" f"\n[Eval Started]\n"
f"Inputs: {inputs}\n" f"Inputs: {inputs}\n"
@ -15,9 +14,9 @@ def run_eval(inputs, native, other, outputs):
with gr.Blocks(title="EvalScope 全功能界面") as demo: with gr.Blocks(title="EvalScope 全功能界面") as demo:
gr.Markdown("## EvalScope 功能选择平台") gr.Markdown("## EvalScope 功能选择平台")
with gr.Row(): with gr.Group():
with gr.Column(): gr.Markdown("### INPUT 输入区")
gr.Markdown("### INPUT 输入区") with gr.Row():
input_choices = gr.CheckboxGroup( input_choices = gr.CheckboxGroup(
label="选择输入源", label="选择输入源",
choices=["API Models", "Local Models", "Benchmarks", "Custom Datasets"] choices=["API Models", "Local Models", "Benchmarks", "Custom Datasets"]
@ -25,22 +24,24 @@ with gr.Blocks(title="EvalScope 全功能界面") as demo:
with gr.Row(): with gr.Row():
with gr.Column(): with gr.Column():
gr.Markdown("### NATIVE 本地功能区") with gr.Group():
native_choices = gr.CheckboxGroup( gr.Markdown("### NATIVE 本地功能区")
label="启用本地模块", native_choices = gr.CheckboxGroup(
choices=["Model Adapter", "Data Adapter", "Evaluator", "Perf Monitor"] label="启用本地模块",
) choices=["Model Adapter", "Data Adapter", "Evaluator", "Perf Monitor"]
)
with gr.Column(): with gr.Column():
gr.Markdown("### OTHER 其他功能区") with gr.Group():
other_choices = gr.CheckboxGroup( gr.Markdown("### OTHER 其他功能区")
label="启用外部后端", other_choices = gr.CheckboxGroup(
choices=["OpenCompass", "VLMEvalKit", "RAGAS", "MTEB/CMTEB"] label="启用外部后端",
) choices=["OpenCompass", "VLMEvalKit", "RAGAS", "MTEB/CMTEB"]
)
with gr.Row(): with gr.Group():
with gr.Column(): gr.Markdown("### OUTPUT 输出区")
gr.Markdown("### OUTPUT 输出区") with gr.Row():
output_choices = gr.CheckboxGroup( output_choices = gr.CheckboxGroup(
label="输出形式", label="输出形式",
choices=["Evaluation Report", "Gradio", "WandB", "Swanlab"] choices=["Evaluation Report", "Gradio", "WandB", "Swanlab"]
@ -53,3 +54,4 @@ with gr.Blocks(title="EvalScope 全功能界面") as demo:
if __name__ == '__main__': if __name__ == '__main__':
demo.launch(server_name="0.0.0.0", server_port=7900) demo.launch(server_name="0.0.0.0", server_port=7900)