Spaces:
Runtime error
Runtime error
Explain submission format
Browse files- app.py +30 -4
- submission.json → sample-submission.json +1 -33
app.py
CHANGED
@@ -49,14 +49,40 @@ def http_post(
|
|
49 |
with st.form(key="form"):
|
50 |
# Flush local repo
|
51 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
52 |
-
uploaded_file = st.file_uploader("Upload
|
53 |
|
54 |
if uploaded_file is not None:
|
55 |
data = str(uploaded_file.read(), "utf-8")
|
56 |
json_data = json.loads(data)
|
57 |
|
58 |
-
with st.expander("
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
example_submission = json.load(f)
|
61 |
st.json(example_submission)
|
62 |
|
@@ -66,7 +92,7 @@ with st.form(key="form"):
|
|
66 |
help="You can generate an access token via your Hub settings. See the [docs](https://huggingface.co/docs/hub/security#user-access-tokens) for more details",
|
67 |
)
|
68 |
|
69 |
-
submit_button = st.form_submit_button("
|
70 |
|
71 |
if submit_button:
|
72 |
validate_submission(json_data)
|
|
|
49 |
with st.form(key="form"):
|
50 |
# Flush local repo
|
51 |
shutil.rmtree(LOCAL_REPO, ignore_errors=True)
|
52 |
+
uploaded_file = st.file_uploader("Upload submission.json file", type=["json"])
|
53 |
|
54 |
if uploaded_file is not None:
|
55 |
data = str(uploaded_file.read(), "utf-8")
|
56 |
json_data = json.loads(data)
|
57 |
|
58 |
+
with st.expander("Submission format"):
|
59 |
+
st.markdown(
|
60 |
+
"""
|
61 |
+
Please follow this JSON format for your `submission.json` file:
|
62 |
+
|
63 |
+
```json
|
64 |
+
{
|
65 |
+
"submission_name": "An identifying name of your system",
|
66 |
+
"param_count": 123, # The number of parameters your system has.
|
67 |
+
"description": "An optional brief description of the system that will be shown on the results page",
|
68 |
+
"tasks":
|
69 |
+
{
|
70 |
+
"dataset_identifier": {
|
71 |
+
"values": ["output1", "output2", "..."], # A list of system outputs.
|
72 |
+
# Optionally, you can add the keys which are part of an example to ensure that there is no shuffling mistakes.
|
73 |
+
"keys": ["key-0", "key-1", ...]
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
```
|
78 |
+
In this case, `dataset_identifier` is the identifier of the dataset
|
79 |
+
followed by an identifier of the set the outputs were created from, for
|
80 |
+
example `_validation` or `_test`. For example, the `mlsum_de` test set
|
81 |
+
would have the identifier `mlsum_de_test`. the Please see the sample
|
82 |
+
submission below:
|
83 |
+
"""
|
84 |
+
)
|
85 |
+
with open("sample-submission.json", "r") as f:
|
86 |
example_submission = json.load(f)
|
87 |
st.json(example_submission)
|
88 |
|
|
|
92 |
help="You can generate an access token via your Hub settings. See the [docs](https://huggingface.co/docs/hub/security#user-access-tokens) for more details",
|
93 |
)
|
94 |
|
95 |
+
submit_button = st.form_submit_button("Make Submission")
|
96 |
|
97 |
if submit_button:
|
98 |
validate_submission(json_data)
|
submission.json → sample-submission.json
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"submission_name": "T5-base",
|
3 |
"param_count": 222903552,
|
4 |
-
"description": "",
|
5 |
"tasks": {
|
6 |
"mlsum_de_test": {
|
7 |
"values": [
|
@@ -34,38 +34,6 @@
|
|
34 |
"mlsum_de-challenge_test_covid-0",
|
35 |
"mlsum_de-challenge_test_covid-1"
|
36 |
]
|
37 |
-
},
|
38 |
-
"mlsum_es_test": {
|
39 |
-
"values": [
|
40 |
-
"El PSOE y el PNV aprovechan la moción de censura que convirtió a Sánchez en presidente del Gobierno",
|
41 |
-
"El desfile de las Fuerzas Armadas estará presidido por los Reyes de Espa ⁇ a"
|
42 |
-
],
|
43 |
-
"keys": [
|
44 |
-
"mlsum_es-test-0",
|
45 |
-
"mlsum_es-test-1"
|
46 |
-
]
|
47 |
-
},
|
48 |
-
"mlsum_es_challenge_train_sample": {
|
49 |
-
"values": [
|
50 |
-
"La red gaditana de Gibraltar emplea 60.000 euros por alijo para cobrar un lanchero de las organizaciones del narcotráfico",
|
51 |
-
"La Junta de Andaluc ⁇ a encarga el Centro de Estudios y Experimentación en Obras P ⁇ blicas para analizar la capacidad máxima del r ⁇ o"
|
52 |
-
]
|
53 |
-
},
|
54 |
-
"mlsum_es_challenge_validation_sample": {
|
55 |
-
"values": [
|
56 |
-
"Un nuevo estudio retrasa el horario de la primera clase de la jornada y el aumento de las calificaciones fue del 4,5%",
|
57 |
-
"La hija de una toledana, Laura Sanz Nombela, acaecida en una panader ⁇ a, se encuentran en el hospital de la capital francesa"
|
58 |
-
]
|
59 |
-
},
|
60 |
-
"mlsum_es_challenge_test_covid": {
|
61 |
-
"values": [
|
62 |
-
"El 75% de los pacientes en lista de espera quir ⁇ rgica en grandes hospitales esperan intervenirse y pidiendo un aplazamiento",
|
63 |
-
"La empresa Viralgen, que apuesta por el coronavirus, apuesta por el ant ⁇ geno para proteger frente al coronavirus"
|
64 |
-
],
|
65 |
-
"keys": [
|
66 |
-
"mlsum_es-challenge_test_covid-0",
|
67 |
-
"mlsum_es-challenge_test_covid-1"
|
68 |
-
]
|
69 |
}
|
70 |
}
|
71 |
}
|
|
|
1 |
{
|
2 |
"submission_name": "T5-base",
|
3 |
"param_count": 222903552,
|
4 |
+
"description": "Sample submission with model predictions across multiple datasets",
|
5 |
"tasks": {
|
6 |
"mlsum_de_test": {
|
7 |
"values": [
|
|
|
34 |
"mlsum_de-challenge_test_covid-0",
|
35 |
"mlsum_de-challenge_test_covid-1"
|
36 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
}
|
39 |
}
|