zsss0316 commited on
Commit
549676f
·
verified ·
1 Parent(s): 82a144f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +41 -35
index.html CHANGED
@@ -2,66 +2,72 @@
2
  <head>
3
  <meta charset="UTF-8">
4
  <title>Infernet Leaderboard</title>
5
- <!-- 加载 Gradio-lite 引擎 -->
6
  <script type="module" src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
7
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" />
8
  <style>
9
- body { background-color: #f9fafb; }
 
10
  </style>
11
  </head>
12
  <body>
13
  <gradio-lite>
14
- <!-- 这里编写您的 Python 代码 -->
15
  <gradio-file name="app.py" entrypoint>
16
  import gradio as gr
17
- import pandas as pd
18
- import io
19
 
20
- # 1. 模拟数据(您也可以在此处直接修改数据
21
- data_csv = """Model,Compilation %,Replication %,Direction %
22
- Econometrics-Agent (Ours),92.5,88.0,85.0
23
- GPT-4o,98.0,82.5,75.1
24
- Claude 3.5 Sonnet,96.2,80.4,72.8
25
- Llama-3-70B,85.0,65.0,60.5
26
- """
 
27
 
28
- def load_data():
29
- df = pd.read_csv(io.StringIO(data_csv))
30
- df["Overall Score"] = df[["Compilation %", "Replication %", "Direction %"]].mean(axis=1).round(2)
31
- return df.sort_values("Overall Score", ascending=False)
 
 
 
 
32
 
33
  # 2. 界面构建
34
  with gr.Blocks(title="Infernet Leaderboard") as demo:
35
- gr.HTML("<h1 style='text-align: center; color: #1f2937;'>🏆 Infernet Econometrics Leaderboard</h1>")
36
- gr.HTML("<p style='text-align: center; color: #6b7280;'>CamoAiLab | Free Browser-based Edition</p>")
37
 
38
  with gr.Row():
39
- df_init = load_data()
40
- gr.Number(label="Total Models", value=len(df_init), interactive=False)
41
- gr.Number(label="Best Overall (%)", value=df_init["Overall Score"].max(), interactive=False)
42
 
43
  gr.Markdown("---")
44
 
45
  with gr.Tabs():
46
- with gr.TabItem("📊 Leaderboard"):
47
- search = gr.Textbox(placeholder="🔍 Search model...", label=None, show_label=False)
48
- table = gr.Dataframe(value=df_init, interactive=False)
49
-
50
- def filter_table(query):
51
- full_df = load_data()
52
- if not query: return full_df
53
- return full_df[full_df["Model"].str.contains(query, case=False)]
 
54
 
55
- search.change(fn=filter_table, inputs=search, outputs=table)
56
 
57
- with gr.TabItem("📖 Definitions"):
58
  gr.Markdown("""
59
- ### 计量经济学评测指标
60
- - **Compilation %**: 代码运行成功率。
61
- - **Replication %**: 统计结果复现率
62
- - **Direction %**: **核心指标**。系数正负号正确率
 
63
  """)
64
 
 
 
 
65
  demo.launch()
66
  </gradio-file>
67
  </gradio-lite>
 
2
  <head>
3
  <meta charset="UTF-8">
4
  <title>Infernet Leaderboard</title>
 
5
  <script type="module" src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
6
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" />
7
  <style>
8
+ body { background-color: #f3f4f6; padding-top: 20px; }
9
+ .gradio-container { border-radius: 15px !important; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1 ) !important; }
10
  </style>
11
  </head>
12
  <body>
13
  <gradio-lite>
 
14
  <gradio-file name="app.py" entrypoint>
15
  import gradio as gr
 
 
16
 
17
+ # 1. 核心数据(原生列表格式,无需 pandas
18
+ # 格式:[模型名, 编译%, 复现%, 方向%, 综合分]
19
+ RAW_DATA = [
20
+ ["Econometrics-Agent (Ours)", 92.5, 88.0, 85.0, 88.5],
21
+ ["GPT-4o", 98.0, 82.5, 75.1, 85.2],
22
+ ["Claude 3.5 Sonnet", 96.2, 80.4, 72.8, 83.1],
23
+ ["Llama-3-70B", 85.0, 65.0, 60.5, 70.2]
24
+ ]
25
 
26
+ HEADERS = ["Model", "Compilation %", "Replication %", "Direction %", "Overall Score"]
27
+
28
+ def get_leaderboard(query=""):
29
+ # 过滤与排序逻辑
30
+ filtered = [row for row in RAW_DATA if query.lower() in row[0].lower()]
31
+ # 按最后一列(综合分)降序排列
32
+ sorted_data = sorted(filtered, key=lambda x: x[4], reverse=True)
33
+ return sorted_data
34
 
35
  # 2. 界面构建
36
  with gr.Blocks(title="Infernet Leaderboard") as demo:
37
+ gr.HTML("<h1 style='text-align: center; color: #111827;'>🏆 Infernet Econometrics Leaderboard</h1>")
38
+ gr.HTML("<p style='text-align: center; color: #4b5563; margin-bottom: 20px;'>CamoAiLab | Browser-based Empirical AI Benchmark</p>")
39
 
40
  with gr.Row():
41
+ gr.Number(label="Total Models", value=len(RAW_DATA), interactive=False)
42
+ gr.Number(label="Best Score (%)", value=max(row[4] for row in RAW_DATA), interactive=False)
 
43
 
44
  gr.Markdown("---")
45
 
46
  with gr.Tabs():
47
+ with gr.TabItem("📊 Main Leaderboard"):
48
+ search = gr.Textbox(placeholder="🔍 Search for a model...", label=None, show_label=False)
49
+ # 使用原生列表渲染表格
50
+ table = gr.Dataframe(
51
+ headers=HEADERS,
52
+ value=get_leaderboard(),
53
+ datatype=["str", "number", "number", "number", "number"],
54
+ interactive=False
55
+ )
56
 
57
+ search.change(fn=get_leaderboard, inputs=search, outputs=table)
58
 
59
+ with gr.TabItem("📖 Metric Definitions"):
60
  gr.Markdown("""
61
+ ### 🔍 计量经济学评测指标说明
62
+
63
+ 1. **Compilation %**: Agent 生成的代码是否能成功运行通过
64
+ 2. **Replication %**: 回归系数等结果与原始论文的重合度
65
+ 3. **Direction %**: **核心指标**。回归系数的正负号预测是否正确。
66
  """)
67
 
68
+ with gr.TabItem("✉️ Submission"):
69
+ gr.Markdown("请将您的预测文件上传至 [CamoAiLab/Infernet](https://huggingface.co/datasets/CamoAiLab/Infernet ) 社区。")
70
+
71
  demo.launch()
72
  </gradio-file>
73
  </gradio-lite>