Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
·
d5432ec
1
Parent(s):
b789e9f
new check on file len
Browse files
app.py
CHANGED
@@ -29,6 +29,7 @@ api = HfApi()
|
|
29 |
|
30 |
YEAR_VERSION = "2023"
|
31 |
ref_scores_len = {"validation": 165, "test": 301}
|
|
|
32 |
|
33 |
os.makedirs("scored", exist_ok=True)
|
34 |
|
@@ -145,6 +146,9 @@ def add_new_eval(
|
|
145 |
if len(task_ids) != len(set(task_ids)):
|
146 |
return format_error("There are duplicates in your submission. Please check your file and resubmit it.")
|
147 |
|
|
|
|
|
|
|
148 |
# Save scored file
|
149 |
api.upload_file(
|
150 |
repo_id=SUBMISSION_DATASET,
|
|
|
29 |
|
30 |
YEAR_VERSION = "2023"
|
31 |
ref_scores_len = {"validation": 165, "test": 301}
|
32 |
+
ref_level_len = {"validation": {1: 53, 2: 86, 3: 26}, "test": {1: 93, 2: 159, 3: 49}}
|
33 |
|
34 |
os.makedirs("scored", exist_ok=True)
|
35 |
|
|
|
146 |
if len(task_ids) != len(set(task_ids)):
|
147 |
return format_error("There are duplicates in your submission. Please check your file and resubmit it.")
|
148 |
|
149 |
+
if any([num_questions[level] != ref_level_len[val_or_test][level] for level in [1, 2, 3]]):
|
150 |
+
return format_error(f"Your submission has {num_questions[1]} questions for level 1, {num_questions[2]} for level 2, and {num_questions[3]} for level 3, but it should have {ref_level_len[val_or_test][1]}, {ref_level_len[val_or_test][2]}, and {ref_level_len[val_or_test][3]} respectively. Please check your submission.")
|
151 |
+
|
152 |
# Save scored file
|
153 |
api.upload_file(
|
154 |
repo_id=SUBMISSION_DATASET,
|