liujiaxiang commited on
Commit
563a4fa
·
verified ·
1 Parent(s): 81ca70d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -5
app.py CHANGED
@@ -1,5 +1,31 @@
1
- git checkout -b feature/add_file_a # 创建并切换新分支
2
- echo "This is A's file." > a.txt # 创建 a.txt
3
- git add a.txt
4
- git commit -m "feat: add a.txt by A"
5
- git push origin feature/add_file_a # 推送到远程
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from utils.grace_plot import plot_radar
3
+ from model_wrappers.model_a import run_model_a
4
+ from model_wrappers.model_b import run_model_b
5
+
6
+ def run_all_models(prompt):
7
+ return run_model_a(prompt), run_model_b(prompt)
8
+
9
+ with gr.Blocks() as demo:
10
+ with gr.Tab("LLM Benchmark"):
11
+ gr.Markdown("## ✨ 模型 GRACE 维度雷达图")
12
+ with gr.Row():
13
+ plot_btn = gr.Button("生成 GRACE 雷达图")
14
+ radar_output = gr.Plot()
15
+ plot_btn.click(fn=plot_radar, inputs=[], outputs=radar_output)
16
+
17
+ with gr.Tab("Arena"):
18
+ gr.Markdown("## 🤖 模型竞技场:同一输入比拼")
19
+ prompt = gr.Textbox(label="请输入 Prompt")
20
+ run_btn = gr.Button("运行所有模型")
21
+ output_a = gr.Textbox(label="Model A 输出")
22
+ output_b = gr.Textbox(label="Model B 输出")
23
+ run_btn.click(fn=run_all_models, inputs=[prompt], outputs=[output_a, output_b])
24
+
25
+ with gr.Tab("Report"):
26
+ with open("report.md", encoding="utf-8") as f:
27
+ report_md = f.read()
28
+ gr.Markdown(report_md)
29
+
30
+ if __name__ == "__main__":
31
+ demo.launch()