Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def plot_average_scores():
|
|
51 |
df_full["Average Score"] = df_full.iloc[:, 2:].mean(axis=1)
|
52 |
df_avg_sorted = df_full.sort_values(by="Average Score", ascending=False)
|
53 |
|
54 |
-
plt.figure(figsize=(
|
55 |
plt.barh(df_avg_sorted["Model Configuration"], df_avg_sorted["Average Score"])
|
56 |
plt.title("Average Performance of Models Across Tasks", fontsize=16)
|
57 |
plt.xlabel("Average Score", fontsize=14)
|
@@ -75,7 +75,7 @@ def plot_average_scores():
|
|
75 |
def plot_task_performance():
|
76 |
df_full_melted = df_full.melt(id_vars=["Model Configuration", "Model Link"], var_name="Task", value_name="Score")
|
77 |
|
78 |
-
plt.figure(figsize=(
|
79 |
for model in df_full["Model Configuration"]:
|
80 |
model_data = df_full_melted[df_full_melted["Model Configuration"] == model]
|
81 |
plt.plot(model_data["Task"], model_data["Score"], marker="o", label=model)
|
@@ -105,7 +105,7 @@ def plot_task_specific_top_models():
|
|
105 |
|
106 |
results = pd.DataFrame({"Top Model": top_models, "Score": top_scores}).reset_index().rename(columns={"index": "Task"})
|
107 |
|
108 |
-
plt.figure(figsize=(
|
109 |
plt.bar(results["Task"], results["Score"])
|
110 |
plt.title("Task-Specific Top Models", fontsize=16)
|
111 |
plt.xlabel("Task", fontsize=14)
|
@@ -139,7 +139,7 @@ def scrape_mergekit_config(model_name):
|
|
139 |
return f"No YAML configuration found for {model_name}."
|
140 |
|
141 |
def plot_heatmap():
|
142 |
-
plt.figure(figsize=(
|
143 |
sns.heatmap(df_full.iloc[:, 2:], annot=True, cmap="YlGnBu", xticklabels=columns[2:], yticklabels=df_full["Model Configuration"])
|
144 |
plt.title("Performance Heatmap", fontsize=16)
|
145 |
plt.tight_layout()
|
@@ -240,40 +240,28 @@ with gr.Blocks() as demo:
|
|
240 |
gr.Markdown("# Comprehensive Model Performance Analysis with Hugging Face Links")
|
241 |
|
242 |
with gr.Row():
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
img1 = gr.Image(type="pil", label="Average Performance Plot")
|
247 |
-
with gr.Column(width=2):
|
248 |
-
img1_download = gr.File(label="Download Average Performance")
|
249 |
btn1.click(plot_average_scores, outputs=[img1,img1_download])
|
250 |
|
251 |
with gr.Row():
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
img2 = gr.Image(type="pil", label="Task Performance Plot")
|
256 |
-
with gr.Column(width=2):
|
257 |
-
img2_download = gr.File(label="Download Task Performance")
|
258 |
btn2.click(plot_task_performance, outputs=[img2, img2_download])
|
259 |
|
260 |
with gr.Row():
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
img3 = gr.Image(type="pil", label="Task-Specific Top Models Plot")
|
265 |
-
with gr.Column(width=2):
|
266 |
-
img3_download = gr.File(label="Download Top Models")
|
267 |
btn3.click(plot_task_specific_top_models, outputs=[img3, img3_download])
|
268 |
|
269 |
with gr.Row():
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
with gr.Column(width=2):
|
275 |
-
heatmap_download = gr.File(label="Download Heatmap")
|
276 |
-
btn4.click(plot_heatmap, outputs=[heatmap_img, heatmap_download])
|
277 |
|
278 |
with gr.Row():
|
279 |
model_selector = gr.Dropdown(choices=df_full["Model Configuration"].tolist(), label="Select a Model")
|
|
|
51 |
df_full["Average Score"] = df_full.iloc[:, 2:].mean(axis=1)
|
52 |
df_avg_sorted = df_full.sort_values(by="Average Score", ascending=False)
|
53 |
|
54 |
+
plt.figure(figsize=(14, 10))
|
55 |
plt.barh(df_avg_sorted["Model Configuration"], df_avg_sorted["Average Score"])
|
56 |
plt.title("Average Performance of Models Across Tasks", fontsize=16)
|
57 |
plt.xlabel("Average Score", fontsize=14)
|
|
|
75 |
def plot_task_performance():
|
76 |
df_full_melted = df_full.melt(id_vars=["Model Configuration", "Model Link"], var_name="Task", value_name="Score")
|
77 |
|
78 |
+
plt.figure(figsize=(16, 12))
|
79 |
for model in df_full["Model Configuration"]:
|
80 |
model_data = df_full_melted[df_full_melted["Model Configuration"] == model]
|
81 |
plt.plot(model_data["Task"], model_data["Score"], marker="o", label=model)
|
|
|
105 |
|
106 |
results = pd.DataFrame({"Top Model": top_models, "Score": top_scores}).reset_index().rename(columns={"index": "Task"})
|
107 |
|
108 |
+
plt.figure(figsize=(14, 8))
|
109 |
plt.bar(results["Task"], results["Score"])
|
110 |
plt.title("Task-Specific Top Models", fontsize=16)
|
111 |
plt.xlabel("Task", fontsize=14)
|
|
|
139 |
return f"No YAML configuration found for {model_name}."
|
140 |
|
141 |
def plot_heatmap():
|
142 |
+
plt.figure(figsize=(14, 10))
|
143 |
sns.heatmap(df_full.iloc[:, 2:], annot=True, cmap="YlGnBu", xticklabels=columns[2:], yticklabels=df_full["Model Configuration"])
|
144 |
plt.title("Performance Heatmap", fontsize=16)
|
145 |
plt.tight_layout()
|
|
|
240 |
gr.Markdown("# Comprehensive Model Performance Analysis with Hugging Face Links")
|
241 |
|
242 |
with gr.Row():
|
243 |
+
btn1 = gr.Button("Show Average Performance")
|
244 |
+
img1 = gr.Image(type="pil", label="Average Performance Plot")
|
245 |
+
img1_download = gr.File(label="Download Average Performance")
|
|
|
|
|
|
|
246 |
btn1.click(plot_average_scores, outputs=[img1,img1_download])
|
247 |
|
248 |
with gr.Row():
|
249 |
+
btn2 = gr.Button("Show Task Performance")
|
250 |
+
img2 = gr.Image(type="pil", label="Task Performance Plot")
|
251 |
+
img2_download = gr.File(label="Download Task Performance")
|
|
|
|
|
|
|
252 |
btn2.click(plot_task_performance, outputs=[img2, img2_download])
|
253 |
|
254 |
with gr.Row():
|
255 |
+
btn3 = gr.Button("Task-Specific Top Models")
|
256 |
+
img3 = gr.Image(type="pil", label="Task-Specific Top Models Plot")
|
257 |
+
img3_download = gr.File(label="Download Top Models")
|
|
|
|
|
|
|
258 |
btn3.click(plot_task_specific_top_models, outputs=[img3, img3_download])
|
259 |
|
260 |
with gr.Row():
|
261 |
+
btn4 = gr.Button("Plot Performance Heatmap")
|
262 |
+
heatmap_img = gr.Image(type="pil", label="Performance Heatmap")
|
263 |
+
heatmap_download = gr.File(label="Download Heatmap")
|
264 |
+
btn4.click(plot_heatmap, outputs=[heatmap_img, heatmap_download])
|
|
|
|
|
|
|
265 |
|
266 |
with gr.Row():
|
267 |
model_selector = gr.Dropdown(choices=df_full["Model Configuration"].tolist(), label="Select a Model")
|