tohid.abedini
commited on
Commit
·
c8e1af0
1
Parent(s):
00e3432
[Add] jsonl load handling
Browse files
app.py
CHANGED
@@ -10,7 +10,8 @@ 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
|
|
|
14 |
|
15 |
|
16 |
def fill_form(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license):
|
@@ -101,7 +102,7 @@ abs_path = Path(__file__).parent
|
|
101 |
|
102 |
# Any pandas-compatible data
|
103 |
# persian_df = pd.read_json(str(abs_path / "leaderboard_persian.jsonl"))
|
104 |
-
persian_df =
|
105 |
base_df = pd.read_json(str(abs_path / "leaderboard_base.json"))
|
106 |
|
107 |
with gr.Blocks(css=custom_css) as demo:
|
|
|
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, load_jsonl_with_check
|
14 |
+
|
15 |
|
16 |
|
17 |
def fill_form(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license):
|
|
|
102 |
|
103 |
# Any pandas-compatible data
|
104 |
# persian_df = pd.read_json(str(abs_path / "leaderboard_persian.jsonl"))
|
105 |
+
persian_df = load_jsonl_with_check(str(abs_path / "leaderboard_persian.jsonl"))
|
106 |
base_df = pd.read_json(str(abs_path / "leaderboard_base.json"))
|
107 |
|
108 |
with gr.Blocks(css=custom_css) as demo:
|
utils.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
custom_css = """
|
2 |
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn&display=swap');
|
3 |
body, .gradio-container, .gr-button, .gr-input, .gr-slider, .gr-dropdown, .gr-markdown {
|
@@ -132,4 +135,16 @@ LLM_BENCHMARKS_SUBMIT_TEXT = """## Submit your model
|
|
132 |
After a brief technical review by our organizers we will grant you a free GPU until MLSB so that anyone can play with the model and we will run the evaluation.
|
133 |
|
134 |
If you have a questions please email: [email protected]
|
135 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
|
3 |
+
|
4 |
custom_css = """
|
5 |
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn&display=swap');
|
6 |
body, .gradio-container, .gr-button, .gr-input, .gr-slider, .gr-dropdown, .gr-markdown {
|
|
|
135 |
After a brief technical review by our organizers we will grant you a free GPU until MLSB so that anyone can play with the model and we will run the evaluation.
|
136 |
|
137 |
If you have a questions please email: [email protected]
|
138 |
+
"""
|
139 |
+
|
140 |
+
|
141 |
+
def load_jsonl_with_check(file_path):
|
142 |
+
data = []
|
143 |
+
with open(file_path, 'r', encoding='utf-8') as file:
|
144 |
+
for idx, line in enumerate(file):
|
145 |
+
try:
|
146 |
+
data.append(pd.json.loads(line.strip()))
|
147 |
+
except ValueError as e:
|
148 |
+
print(f"Error parsing line {idx + 1}: {line.strip()}")
|
149 |
+
print(f"Error details: {e}")
|
150 |
+
return pd.DataFrame(data)
|