Clémentine commited on
Commit
c9ce27a
·
1 Parent(s): d699a55

now forces login

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -78,6 +78,7 @@ def add_new_eval(
78
  path_to_file: str,
79
  organisation: str,
80
  mail: str,
 
81
  ):
82
  is_validation = val_or_test == "validation"
83
  # Very basic email parsing
@@ -117,7 +118,7 @@ def add_new_eval(
117
  return format_error(f"Line {ix} is incorrectly formatted. Please fix it and resubmit your file.")
118
 
119
  if "model_answer" not in task:
120
- raise format_error(f"Line {ix} contains no model_answer key. Please fix it and resubmit your file.")
121
  answer = task["model_answer"]
122
  task_id = task["task_id"]
123
  try:
@@ -192,7 +193,7 @@ def add_new_eval(
192
  "model": model,
193
  "model_family": model_family,
194
  "url": url,
195
- "organisation": organisation,
196
  "mail": mail,
197
  }
198
  contact_infos[val_or_test]= contact_infos[val_or_test].add_item(contact_info)
@@ -261,7 +262,9 @@ with demo:
261
  file_output = gr.File()
262
 
263
 
264
- submit_button = gr.Button("Submit Eval")
 
 
265
  submission_result = gr.Markdown()
266
  submit_button.click(
267
  add_new_eval,
 
78
  path_to_file: str,
79
  organisation: str,
80
  mail: str,
81
+ profile: gr.OAuthProfile,
82
  ):
83
  is_validation = val_or_test == "validation"
84
  # Very basic email parsing
 
118
  return format_error(f"Line {ix} is incorrectly formatted. Please fix it and resubmit your file.")
119
 
120
  if "model_answer" not in task:
121
+ return format_error(f"Line {ix} contains no model_answer key. Please fix it and resubmit your file.")
122
  answer = task["model_answer"]
123
  task_id = task["task_id"]
124
  try:
 
193
  "model": model,
194
  "model_family": model_family,
195
  "url": url,
196
+ "organisation": f"{organisation} | user {profile.username}",
197
  "mail": mail,
198
  }
199
  contact_infos[val_or_test]= contact_infos[val_or_test].add_item(contact_info)
 
262
  file_output = gr.File()
263
 
264
 
265
+ with gr.Row():
266
+ gr.LoginButton()
267
+ submit_button = gr.Button("Submit Eval")
268
  submission_result = gr.Markdown()
269
  submit_button.click(
270
  add_new_eval,