Spaces:
Sleeping
Sleeping
Commit
•
e611814
1
Parent(s):
c660995
Remove only-script part
Browse files
app.py
CHANGED
@@ -51,39 +51,39 @@ def render_result_2(model_id, results):
|
|
51 |
return pd.concat([results.iloc[:, [0, 1]].set_index("Parameters"), result], axis=1).reset_index()
|
52 |
|
53 |
|
54 |
-
if __name__ == "__main__":
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
)
|
77 |
-
|
78 |
-
load_btn_1.click(
|
79 |
-
fn=render_result_1,
|
80 |
-
inputs=[model_id_1, compared_results],
|
81 |
-
outputs=compared_results,
|
82 |
-
)
|
83 |
-
load_btn_2.click(
|
84 |
-
fn=render_result_2,
|
85 |
-
inputs=[model_id_2, compared_results],
|
86 |
-
outputs=compared_results,
|
87 |
)
|
88 |
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
return pd.concat([results.iloc[:, [0, 1]].set_index("Parameters"), result], axis=1).reset_index()
|
52 |
|
53 |
|
54 |
+
# if __name__ == "__main__":
|
55 |
+
latest_result_path_per_model = filter_latest_result_path_per_model(fetch_result_paths())
|
56 |
+
|
57 |
+
with gr.Blocks(fill_height=True) as demo:
|
58 |
+
gr.HTML("<h1 style='text-align: center;'>Compare Results of the 🤗 Open LLM Leaderboard</h1>")
|
59 |
+
gr.HTML("<h3 style='text-align: center;'>Select 2 results to load and compare</h3>")
|
60 |
+
|
61 |
+
with gr.Row():
|
62 |
+
with gr.Column():
|
63 |
+
model_id_1 = gr.Dropdown(choices=list(latest_result_path_per_model.keys()), label="Results")
|
64 |
+
load_btn_1 = gr.Button("Load")
|
65 |
+
with gr.Column():
|
66 |
+
model_id_2 = gr.Dropdown(choices=list(latest_result_path_per_model.keys()), label="Results")
|
67 |
+
load_btn_2 = gr.Button("Load")
|
68 |
+
|
69 |
+
with gr.Row():
|
70 |
+
compared_results = gr.Dataframe(
|
71 |
+
label="Results",
|
72 |
+
headers=["Parameters", "Result-1", "Result-2"],
|
73 |
+
interactive=False,
|
74 |
+
column_widths=["30%", "30%", "30%"],
|
75 |
+
wrap=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
)
|
77 |
|
78 |
+
load_btn_1.click(
|
79 |
+
fn=render_result_1,
|
80 |
+
inputs=[model_id_1, compared_results],
|
81 |
+
outputs=compared_results,
|
82 |
+
)
|
83 |
+
load_btn_2.click(
|
84 |
+
fn=render_result_2,
|
85 |
+
inputs=[model_id_2, compared_results],
|
86 |
+
outputs=compared_results,
|
87 |
+
)
|
88 |
+
|
89 |
+
demo.launch()
|