Spaces:
Runtime error
Runtime error
Add plotting functionality for section results in Gradio app
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
from apscheduler.schedulers.background import BackgroundScheduler
|
3 |
from huggingface_hub import snapshot_download
|
4 |
import pandas as pd
|
|
|
5 |
|
6 |
# Dataset paths
|
7 |
LEADERBOARD_PATH = "hf://datasets/alibayram/yapay_zeka_turkce_mmlu_liderlik_tablosu/data/train-00000-of-00001.parquet"
|
@@ -32,8 +33,13 @@ def search_responses(query, model):
|
|
32 |
return filtered[selected_columns]
|
33 |
|
34 |
def plot_section_results():
|
|
|
35 |
avg_scores = section_results_data.mean(numeric_only=True)
|
36 |
-
|
|
|
|
|
|
|
|
|
37 |
|
38 |
def add_new_model(model_name, base_model, revision, precision, weight_type, model_type):
|
39 |
# Simulated model submission logic
|
|
|
2 |
from apscheduler.schedulers.background import BackgroundScheduler
|
3 |
from huggingface_hub import snapshot_download
|
4 |
import pandas as pd
|
5 |
+
import matplotlib.pyplot as plt
|
6 |
|
7 |
# Dataset paths
|
8 |
LEADERBOARD_PATH = "hf://datasets/alibayram/yapay_zeka_turkce_mmlu_liderlik_tablosu/data/train-00000-of-00001.parquet"
|
|
|
33 |
return filtered[selected_columns]
|
34 |
|
35 |
def plot_section_results():
|
36 |
+
fig, ax = plt.subplots(figsize=(10, 6))
|
37 |
avg_scores = section_results_data.mean(numeric_only=True)
|
38 |
+
avg_scores.plot(kind="bar", ax=ax)
|
39 |
+
ax.set_title("Average Section-Wise Performance")
|
40 |
+
ax.set_ylabel("Accuracy (%)")
|
41 |
+
ax.set_xlabel("Sections")
|
42 |
+
return fig # Return the figure object
|
43 |
|
44 |
def add_new_model(model_name, base_model, revision, precision, weight_type, model_type):
|
45 |
# Simulated model submission logic
|