Spaces:
Runtime error
Runtime error
Add style tweaks
Browse files
app.py
CHANGED
@@ -18,6 +18,10 @@ AUTONLP_USERNAME = os.getenv("AUTONLP_USERNAME")
|
|
18 |
HF_AUTONLP_BACKEND_API = os.getenv("HF_AUTONLP_BACKEND_API")
|
19 |
LOCAL_REPO = "submission_repo"
|
20 |
|
|
|
|
|
|
|
|
|
21 |
|
22 |
###########
|
23 |
### APP ###
|
@@ -70,9 +74,8 @@ with st.form(key="form"):
|
|
70 |
"tasks":
|
71 |
{
|
72 |
"dataset_identifier": {
|
73 |
-
"values": ["
|
74 |
-
|
75 |
-
"keys": ["key-0", "key-1", ...]
|
76 |
}
|
77 |
}
|
78 |
}
|
@@ -80,8 +83,8 @@ with st.form(key="form"):
|
|
80 |
In this case, `dataset_identifier` is the identifier of the dataset
|
81 |
followed by an identifier of the set the outputs were created from, for
|
82 |
example `_validation` or `_test`. For example, the `mlsum_de` test set
|
83 |
-
would have the identifier `mlsum_de_test`. The `keys` field
|
84 |
-
to avoid accidental shuffling
|
85 |
of the `gem_id` for each output example in the same order as your
|
86 |
values. Please see the sample submission below:
|
87 |
"""
|
@@ -110,7 +113,7 @@ if submit_button and submission_errors == 0:
|
|
110 |
submission_name = json_data["submission_name"]
|
111 |
|
112 |
# Create submission dataset under benchmarks ORG
|
113 |
-
dataset_repo_url = f"https://huggingface.co/datasets/
|
114 |
repo = Repository(
|
115 |
local_dir=LOCAL_REPO,
|
116 |
clone_from=dataset_repo_url,
|
@@ -150,9 +153,9 @@ if submit_button and submission_errors == 0:
|
|
150 |
).json()
|
151 |
|
152 |
if json_resp["status"] == 1:
|
153 |
-
st.success(f"β
Submission {submission_name} was successfully submitted
|
154 |
else:
|
155 |
-
st.error("π Oh noes
|
156 |
|
157 |
# Flush local repo
|
158 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
|
|
18 |
HF_AUTONLP_BACKEND_API = os.getenv("HF_AUTONLP_BACKEND_API")
|
19 |
LOCAL_REPO = "submission_repo"
|
20 |
|
21 |
+
## TODO ##
|
22 |
+
# 1. Add check that fields are nested under `tasks` field correctly
|
23 |
+
# 2. Add check that names of tasks and datasets are valid
|
24 |
+
|
25 |
|
26 |
###########
|
27 |
### APP ###
|
|
|
74 |
"tasks":
|
75 |
{
|
76 |
"dataset_identifier": {
|
77 |
+
"values": ["output-0", "output-1", "..."], # A list of system outputs.
|
78 |
+
"keys": ["gem_id-0", "gem_id-1", ...] # A list of GEM IDs.
|
|
|
79 |
}
|
80 |
}
|
81 |
}
|
|
|
83 |
In this case, `dataset_identifier` is the identifier of the dataset
|
84 |
followed by an identifier of the set the outputs were created from, for
|
85 |
example `_validation` or `_test`. For example, the `mlsum_de` test set
|
86 |
+
would have the identifier `mlsum_de_test`. The `keys` field is needed
|
87 |
+
to avoid accidental shuffling that will impact your metrics. Simply add a list
|
88 |
of the `gem_id` for each output example in the same order as your
|
89 |
values. Please see the sample submission below:
|
90 |
"""
|
|
|
113 |
submission_name = json_data["submission_name"]
|
114 |
|
115 |
# Create submission dataset under benchmarks ORG
|
116 |
+
dataset_repo_url = f"https://huggingface.co/datasets/GEM-submissions/gem-{user_name}"
|
117 |
repo = Repository(
|
118 |
local_dir=LOCAL_REPO,
|
119 |
clone_from=dataset_repo_url,
|
|
|
153 |
).json()
|
154 |
|
155 |
if json_resp["status"] == 1:
|
156 |
+
st.success(f"β
Submission {submission_name} was successfully submitted for evaluation!")
|
157 |
else:
|
158 |
+
st.error("π Oh noes, there was an error submitting your submission! Please contact the organisers")
|
159 |
|
160 |
# Flush local repo
|
161 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|