Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
·
5822c90
1
Parent(s):
0c95215
downgrade gradio to working version + small nits
Browse files- app.py +6 -3
- content.py +3 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -13,9 +13,9 @@ from huggingface_hub import HfApi
|
|
13 |
|
14 |
# InfoStrings
|
15 |
from scorer import question_scorer
|
16 |
-
from content import format_warning, format_log, TITLE, INTRODUCTION_TEXT, CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT, model_hyperlink
|
17 |
|
18 |
-
TOKEN = os.environ.get("
|
19 |
|
20 |
OWNER="gaia-benchmark"
|
21 |
DATA_DATASET = f"{OWNER}/GAIA"
|
@@ -109,7 +109,10 @@ def add_new_eval(
|
|
109 |
raise Exception("No model_answer key in the file provided")
|
110 |
answer = task["model_answer"]
|
111 |
task_id = task["task_id"]
|
112 |
-
|
|
|
|
|
|
|
113 |
|
114 |
score = question_scorer(task['model_answer'], gold_results[val_or_test][task_id]["Final answer"])
|
115 |
|
|
|
13 |
|
14 |
# InfoStrings
|
15 |
from scorer import question_scorer
|
16 |
+
from content import format_error, format_warning, format_log, TITLE, INTRODUCTION_TEXT, CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT, model_hyperlink
|
17 |
|
18 |
+
TOKEN = os.environ.get("WTOKEN", None)
|
19 |
|
20 |
OWNER="gaia-benchmark"
|
21 |
DATA_DATASET = f"{OWNER}/GAIA"
|
|
|
109 |
raise Exception("No model_answer key in the file provided")
|
110 |
answer = task["model_answer"]
|
111 |
task_id = task["task_id"]
|
112 |
+
try:
|
113 |
+
level = int(gold_results[val_or_test][task_id]["Level"])
|
114 |
+
except KeyError:
|
115 |
+
return format_error(f"{task_id} not found in split {val_or_test}. Are you sure you submitted the correct file?")
|
116 |
|
117 |
score = question_scorer(task['model_answer'], gold_results[val_or_test][task_id]["Final answer"])
|
118 |
|
content.py
CHANGED
@@ -30,6 +30,9 @@ CITATION_BUTTON_TEXT = r"""@misc{gaia, # TODO
|
|
30 |
}"""
|
31 |
|
32 |
|
|
|
|
|
|
|
33 |
def format_warning(msg):
|
34 |
return f"<p style='color: orange; font-size: 20px; text-align: center;'>{msg}</p>"
|
35 |
|
|
|
30 |
}"""
|
31 |
|
32 |
|
33 |
+
def format_error(msg):
|
34 |
+
return f"<p style='color: red; font-size: 20px; text-align: center;'>{msg}</p>"
|
35 |
+
|
36 |
def format_warning(msg):
|
37 |
return f"<p style='color: orange; font-size: 20px; text-align: center;'>{msg}</p>"
|
38 |
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
datasets==2.14.5
|
2 |
-
gradio==
|
3 |
huggingface-hub==0.18.0
|
4 |
numpy==1.24.2
|
5 |
APScheduler==3.10.1
|
|
|
1 |
datasets==2.14.5
|
2 |
+
gradio==3.43.2
|
3 |
huggingface-hub==0.18.0
|
4 |
numpy==1.24.2
|
5 |
APScheduler==3.10.1
|