lewtun HF staff commited on
Commit
0398e81
β€’
1 Parent(s): 30c6c6d

Add download button for scores and outputs

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -95,8 +95,9 @@ with st.form(key="form"):
95
  if uploaded_file:
96
  data = str(uploaded_file.read(), "utf-8")
97
  json_data = json.loads(data)
98
- if json_data["submission_name"] in submission_names:
99
- st.error("πŸ™ˆ Submission name is already taken. Please rename your submission")
 
100
  submission_errors += 1
101
  else:
102
  is_valid, message = validate_json(json_data)
@@ -229,3 +230,14 @@ if submit_button and submission_errors == 0:
229
  # # Flush local repos
230
  shutil.rmtree(LOCAL_REPO, ignore_errors=True)
231
  shutil.rmtree(LOGS_REPO, ignore_errors=True)
 
 
 
 
 
 
 
 
 
 
 
 
95
  if uploaded_file:
96
  data = str(uploaded_file.read(), "utf-8")
97
  json_data = json.loads(data)
98
+ submission_name = json_data["submission_name"]
99
+ if submission_name in submission_names:
100
+ st.error(f"πŸ™ˆ Submission name `{submission_name}` is already taken. Please rename your submission.")
101
  submission_errors += 1
102
  else:
103
  is_valid, message = validate_json(json_data)
 
230
  # # Flush local repos
231
  shutil.rmtree(LOCAL_REPO, ignore_errors=True)
232
  shutil.rmtree(LOGS_REPO, ignore_errors=True)
233
+
234
+
235
+ with st.expander("Download all submissions and scores"):
236
+ st.markdown("Click the button below if you'd like to download all the submissions and evaluations from GEM:")
237
+ outputs_url = hf_hub_url(
238
+ "GEM-submissions/v2-outputs-and-scores", "gem-v2-outputs-and-scores.zip", repo_type="dataset"
239
+ )
240
+ outputs_filepath = cached_download(outputs_url)
241
+
242
+ with open(outputs_filepath, "rb") as f:
243
+ btn = st.download_button(label="Download submissions and scores", data=f, file_name="outputs-and-scores.zip")