onekq commited on
Commit
a7cf972
β€’
1 Parent(s): d715186

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -60,7 +60,7 @@ scenarios = df['Scenario'].unique().tolist()
60
  demo = gr.Blocks()
61
 
62
  with demo:
63
- gr.Markdown("# πŸ† WebApp1K Detailed Leaderboard")
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
- leaderboard.render()
 
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()