Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ scenarios = df['Scenario'].unique().tolist()
|
|
60 |
demo = gr.Blocks()
|
61 |
|
62 |
with demo:
|
63 |
-
gr.Markdown("# π WebApp1K
|
64 |
|
65 |
model_input = gr.Dropdown(choices=models, label="Select Model")
|
66 |
scenario_input = gr.Dropdown(choices=scenarios, label="Select Scenario")
|
@@ -70,14 +70,15 @@ with demo:
|
|
70 |
filter_button.click(filter_data, inputs=[model_input, scenario_input], outputs=output)
|
71 |
|
72 |
# Initialize leaderboard with the complete DataFrame
|
73 |
-
complete_pass_at_k = df.groupby('Model').apply(lambda x: pd.Series({
|
74 |
'pass@1': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 1).mean(),
|
75 |
'pass@5': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 5).mean(),
|
76 |
'pass@10': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 10).mean()
|
77 |
})).reset_index()
|
78 |
|
79 |
leaderboard = init_leaderboard(complete_pass_at_k)
|
80 |
-
|
|
|
81 |
|
82 |
# Launch the Gradio interface
|
83 |
demo.launch()
|
|
|
60 |
demo = gr.Blocks()
|
61 |
|
62 |
with demo:
|
63 |
+
gr.Markdown("# π WebApp1K Models Leaderboard")
|
64 |
|
65 |
model_input = gr.Dropdown(choices=models, label="Select Model")
|
66 |
scenario_input = gr.Dropdown(choices=scenarios, label="Select Scenario")
|
|
|
70 |
filter_button.click(filter_data, inputs=[model_input, scenario_input], outputs=output)
|
71 |
|
72 |
# Initialize leaderboard with the complete DataFrame
|
73 |
+
complete_pass_at_k = df.groupby('Model', group_keys=False).apply(lambda x: pd.Series({
|
74 |
'pass@1': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 1).mean(),
|
75 |
'pass@5': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 5).mean(),
|
76 |
'pass@10': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 10).mean()
|
77 |
})).reset_index()
|
78 |
|
79 |
leaderboard = init_leaderboard(complete_pass_at_k)
|
80 |
+
with gr.Row():
|
81 |
+
leaderboard.render()
|
82 |
|
83 |
# Launch the Gradio interface
|
84 |
demo.launch()
|