evijit HF staff commited on
Commit
e0bc7e2
1 Parent(s): 9959b2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -379,7 +379,7 @@ def create_leaderboard(selected_categories):
379
 
380
  # Create entry with numerical scores
381
  model_entry = {
382
- 'Model': model,
383
  'Type': model_type,
384
  'Overall Completion Rate': score_percentage
385
  }
@@ -419,10 +419,14 @@ def create_leaderboard(selected_categories):
419
 
420
  return df
421
 
 
 
 
422
  with gr.Column(visible=True) as leaderboard_tab:
423
- leaderboard_output = gr.DataFrame(
424
- interactive=True, # Allow sorting
425
- wrap=True
 
426
  )
427
 
428
  def create_category_chart(selected_models, selected_categories):
@@ -1242,11 +1246,10 @@ with gr.Blocks(css=css) as demo:
1242
 
1243
  with gr.Column(visible=True) as leaderboard_tab:
1244
  leaderboard_output = gr.DataFrame(
1245
- headers=["Rank", "Model", "Type", "Overall Score"],
1246
- datatype=["number", "str", "str", "str"],
1247
  interactive=False,
1248
  wrap=True
1249
- )
1250
 
1251
  with gr.Column(visible=False) as category_analysis_tab:
1252
  category_chart = gr.Plot()
 
379
 
380
  # Create entry with numerical scores
381
  model_entry = {
382
+ 'AI System': model,
383
  'Type': model_type,
384
  'Overall Completion Rate': score_percentage
385
  }
 
419
 
420
  return df
421
 
422
+ first_model = next(iter(models.values()))
423
+ category_choices = list(first_model['scores'].keys())
424
+
425
  with gr.Column(visible=True) as leaderboard_tab:
426
+ leaderboard_output = gr.DataFrame(
427
+ value=create_leaderboard(category_choices), # Initialize with all categories selected
428
+ interactive=False,
429
+ wrap=True
430
  )
431
 
432
  def create_category_chart(selected_models, selected_categories):
 
1246
 
1247
  with gr.Column(visible=True) as leaderboard_tab:
1248
  leaderboard_output = gr.DataFrame(
1249
+ value=create_leaderboard(category_filter.value), # Initialize with all categories selected
 
1250
  interactive=False,
1251
  wrap=True
1252
+ )
1253
 
1254
  with gr.Column(visible=False) as category_analysis_tab:
1255
  category_chart = gr.Plot()