Spaces:
Sleeping
Sleeping
Sebastian Deatc
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -201,23 +201,30 @@
|
|
201 |
|
202 |
import gradio as gr
|
203 |
import pandas as pd
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
# Gradio Interface
|
218 |
with gr.Blocks() as demo:
|
219 |
-
gr.Markdown("# Benchmark Results")
|
220 |
-
gr.DataFrame(value=
|
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()
|