tohid.abedini
commited on
Commit
·
2cd88e3
1
Parent(s):
dc84365
[Add] average to df
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import json
|
|
10 |
import requests
|
11 |
|
12 |
from envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
|
13 |
-
from utils import LLM_BENCHMARKS_ABOUT_TEXT, LLM_BENCHMARKS_SUBMIT_TEXT, custom_css, jsonl_to_dataframe
|
14 |
|
15 |
|
16 |
|
@@ -104,6 +104,9 @@ abs_path = Path(__file__).parent
|
|
104 |
persian_df = jsonl_to_dataframe(str(abs_path / "leaderboard_persian.jsonl"))
|
105 |
base_df = jsonl_to_dataframe(str(abs_path / "leaderboard_base.jsonl"))
|
106 |
|
|
|
|
|
|
|
107 |
with gr.Blocks(css=custom_css) as demo:
|
108 |
gr.Markdown("""
|
109 |
# Part LLM Leaderboard
|
|
|
10 |
import requests
|
11 |
|
12 |
from envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
|
13 |
+
from utils import LLM_BENCHMARKS_ABOUT_TEXT, LLM_BENCHMARKS_SUBMIT_TEXT, custom_css, jsonl_to_dataframe, compute_averages
|
14 |
|
15 |
|
16 |
|
|
|
104 |
persian_df = jsonl_to_dataframe(str(abs_path / "leaderboard_persian.jsonl"))
|
105 |
base_df = jsonl_to_dataframe(str(abs_path / "leaderboard_base.jsonl"))
|
106 |
|
107 |
+
persian_df = persian_df.append(compute_averages(persian_df), ignore_index=True)
|
108 |
+
base_df = base_df.append(compute_averages(base_df), ignore_index=True)
|
109 |
+
|
110 |
with gr.Blocks(css=custom_css) as demo:
|
111 |
gr.Markdown("""
|
112 |
# Part LLM Leaderboard
|
utils.py
CHANGED
@@ -148,4 +148,10 @@ def load_jsonl(input_file):
|
|
148 |
|
149 |
def jsonl_to_dataframe(input_file):
|
150 |
data = load_jsonl(input_file)
|
151 |
-
return pd.DataFrame(data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
def jsonl_to_dataframe(input_file):
|
150 |
data = load_jsonl(input_file)
|
151 |
+
return pd.DataFrame(data)
|
152 |
+
|
153 |
+
|
154 |
+
def compute_averages(df):
|
155 |
+
average_metrics = df.mean(numeric_only=True).to_dict()
|
156 |
+
average_metrics["Model"] = "Average ⬆️"
|
157 |
+
return average_metrics
|