Sebastian Deatc commited on
Commit
b092502
·
verified ·
1 Parent(s): 43cf100

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -15
app.py CHANGED
@@ -201,23 +201,30 @@
201
 
202
  import gradio as gr
203
  import pandas as pd
204
-
205
- # Sample DataFrame
206
- data = {
207
- 'Model': ['Model A', 'Model B', 'Model C'],
208
- 'Accuracy': [0.95, 0.90, 0.85],
209
- 'F1 Score': [0.96, 0.89, 0.84]
210
- }
211
- df = pd.DataFrame(data)
212
-
213
- # Function to display the DataFrame
214
- def display_table():
215
- return df
 
 
 
 
 
 
 
216
 
217
  # Gradio Interface
218
  with gr.Blocks() as demo:
219
- gr.Markdown("# Benchmark Results")
220
- gr.DataFrame(value=df, label="Benchmark Table", interactive=False) # Display the DataFrame
221
 
222
  # Launch the Gradio app
223
- demo.launch()
 
201
 
202
  import gradio as gr
203
  import pandas as pd
204
+ from tqdm import tqdm
205
+
206
+ # Parameters
207
+ models = ["modelA", "modelB", "modelC"] # Replace with your actual models
208
+ dataset = "my_dataset" # Replace with your actual dataset name
209
+ ROUNDS = 3 # Number of rounds
210
+
211
+ # Load and concatenate data
212
+ data = []
213
+ for model in tqdm(models):
214
+ model_name = model.replace("/", "_")
215
+ for i in range(ROUNDS):
216
+ try:
217
+ df = pd.read_pickle(f"./results/tagged/{dataset}_{model_name}_{i}.pkl")[["Category", "Sub-Category", "model", "round", "tag"]]
218
+ data.append(df)
219
+ except Exception as e:
220
+ print(f"skipping {dataset}_{model_name}_{i}")
221
+
222
+ raw_data = pd.concat(data)
223
 
224
  # Gradio Interface
225
  with gr.Blocks() as demo:
226
+ gr.Markdown("# Aggregated Benchmark Results")
227
+ gr.DataFrame(value=raw_data, label="Benchmark Table", interactive=False) # Display the DataFrame
228
 
229
  # Launch the Gradio app
230
+ demo.launch()