Spaces:
Runtime error
Runtime error
Add contact information
Browse files
app.py
CHANGED
|
@@ -76,21 +76,17 @@ with st.form(key="form"):
|
|
| 76 |
# Flush local repo
|
| 77 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
| 78 |
submission_errors = 0
|
| 79 |
-
uploaded_file = st.file_uploader("Upload submission
|
| 80 |
|
| 81 |
if uploaded_file:
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
else:
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
is_valid, message = validate_json(json_data)
|
| 89 |
-
if is_valid:
|
| 90 |
-
st.success(message)
|
| 91 |
-
else:
|
| 92 |
-
st.error(message)
|
| 93 |
-
submission_errors += 1
|
| 94 |
|
| 95 |
with st.expander("Submission format"):
|
| 96 |
st.markdown(
|
|
@@ -124,7 +120,7 @@ with st.form(key="form"):
|
|
| 124 |
example_submission = json.load(f)
|
| 125 |
st.json(example_submission)
|
| 126 |
|
| 127 |
-
user_name = st.text_input("Enter your π€ Hub username")
|
| 128 |
|
| 129 |
submit_button = st.form_submit_button("Make Submission")
|
| 130 |
|
|
@@ -203,10 +199,14 @@ if submit_button and submission_errors == 0:
|
|
| 203 |
|
| 204 |
* π Click [here](https://huggingface.co/spaces/GEM/results) to view the results from your submission
|
| 205 |
* πΎ Click [here]({dataset_repo_url}) to view your submission file on the Hugging Face Hub
|
|
|
|
|
|
|
| 206 |
"""
|
| 207 |
)
|
| 208 |
else:
|
| 209 |
-
st.error(
|
|
|
|
|
|
|
| 210 |
|
| 211 |
# Flush local repos
|
| 212 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
|
|
|
| 76 |
# Flush local repo
|
| 77 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
| 78 |
submission_errors = 0
|
| 79 |
+
uploaded_file = st.file_uploader("Upload submission file", type=["json"])
|
| 80 |
|
| 81 |
if uploaded_file:
|
| 82 |
+
data = str(uploaded_file.read(), "utf-8")
|
| 83 |
+
json_data = json.loads(data)
|
| 84 |
+
is_valid, message = validate_json(json_data)
|
| 85 |
+
if is_valid:
|
| 86 |
+
st.success(message)
|
| 87 |
else:
|
| 88 |
+
st.error(message)
|
| 89 |
+
submission_errors += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
with st.expander("Submission format"):
|
| 92 |
st.markdown(
|
|
|
|
| 120 |
example_submission = json.load(f)
|
| 121 |
st.json(example_submission)
|
| 122 |
|
| 123 |
+
user_name = st.text_input("Enter your π€ Hub username.")
|
| 124 |
|
| 125 |
submit_button = st.form_submit_button("Make Submission")
|
| 126 |
|
|
|
|
| 199 |
|
| 200 |
* π Click [here](https://huggingface.co/spaces/GEM/results) to view the results from your submission
|
| 201 |
* πΎ Click [here]({dataset_repo_url}) to view your submission file on the Hugging Face Hub
|
| 202 |
+
|
| 203 |
+
Please [contact the organisers](mailto:gehrmann@google.com) if you would like your submission and/or evaluation scores deleted.
|
| 204 |
"""
|
| 205 |
)
|
| 206 |
else:
|
| 207 |
+
st.error(
|
| 208 |
+
"π Oh noes, there was an error submitting your submission! Please [contact the organisers](mailto:gehrmann@google.com)"
|
| 209 |
+
)
|
| 210 |
|
| 211 |
# Flush local repos
|
| 212 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|