Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,6 @@ import gradio as gr
|
|
| 8 |
|
| 9 |
CONFIG = safe_load(open("config.yaml"))
|
| 10 |
label_map = {'Avg':"All", "API":"Web API", "Code": "Code Function", "Customized": "Customized App"}
|
| 11 |
-
|
| 12 |
data = defaultdict(dict)
|
| 13 |
for setting in CONFIG['settings']:
|
| 14 |
for data_type in CONFIG['types']:
|
|
@@ -32,6 +31,7 @@ for setting in CONFIG['settings']:
|
|
| 32 |
remaining_cols = [col for col in cols if col not in first_cols]
|
| 33 |
df = df[first_cols + remaining_cols]
|
| 34 |
|
|
|
|
| 35 |
numeric_cols = df.select_dtypes(include=['float', 'int']).columns
|
| 36 |
for col in numeric_cols:
|
| 37 |
if col != "Rank":
|
|
@@ -120,7 +120,6 @@ NUMERIC_INTERVALS = {
|
|
| 120 |
">1B": pd.Interval(1000, 1_000_000, closed='right'),
|
| 121 |
}
|
| 122 |
|
| 123 |
-
|
| 124 |
def filter_data(search_query, model_types, model_sizes):
|
| 125 |
outputs = []
|
| 126 |
for setting in CONFIG['settings']:
|
|
@@ -179,8 +178,12 @@ def filter_data(search_query, model_types, model_sizes):
|
|
| 179 |
outputs.append(df)
|
| 180 |
return outputs
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
-
with gr.Blocks(css=css) as demo:
|
| 184 |
gr.Markdown("""
|
| 185 |
## Tool-Retrieval benchmark leaderboard
|
| 186 |
|
|
|
|
| 8 |
|
| 9 |
CONFIG = safe_load(open("config.yaml"))
|
| 10 |
label_map = {'Avg':"All", "API":"Web API", "Code": "Code Function", "Customized": "Customized App"}
|
|
|
|
| 11 |
data = defaultdict(dict)
|
| 12 |
for setting in CONFIG['settings']:
|
| 13 |
for data_type in CONFIG['types']:
|
|
|
|
| 31 |
remaining_cols = [col for col in cols if col not in first_cols]
|
| 32 |
df = df[first_cols + remaining_cols]
|
| 33 |
|
| 34 |
+
# 数值格式化:对于数值列(除 Rank 列),如果最大值 <= 1 则认为是比例数据(乘以 100 后保留两位小数),否则直接保留两位小数
|
| 35 |
numeric_cols = df.select_dtypes(include=['float', 'int']).columns
|
| 36 |
for col in numeric_cols:
|
| 37 |
if col != "Rank":
|
|
|
|
| 120 |
">1B": pd.Interval(1000, 1_000_000, closed='right'),
|
| 121 |
}
|
| 122 |
|
|
|
|
| 123 |
def filter_data(search_query, model_types, model_sizes):
|
| 124 |
outputs = []
|
| 125 |
for setting in CONFIG['settings']:
|
|
|
|
| 178 |
outputs.append(df)
|
| 179 |
return outputs
|
| 180 |
|
| 181 |
+
head = """
|
| 182 |
+
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
| 183 |
+
"""
|
| 184 |
+
|
| 185 |
|
| 186 |
+
with gr.Blocks(css=css, fill_width=True, theme=gr.themes.Base(), head=head ) as demo:
|
| 187 |
gr.Markdown("""
|
| 188 |
## Tool-Retrieval benchmark leaderboard
|
| 189 |
|