Update app.py
Browse files
app.py
CHANGED
|
@@ -152,7 +152,7 @@ def add_new_eval(
|
|
| 152 |
# Was the profile created less than 2 month ago?
|
| 153 |
user_data = requests.get(f"https://huggingface.co/api/users/{profile.username}/overview")
|
| 154 |
creation_date = json.loads(user_data.content)["createdAt"]
|
| 155 |
-
if datetime.datetime.now() - datetime.datetime.strptime(creation_date, '%Y-%m-%
|
| 156 |
return format_error("This account is not authorized to submit on this leaderboard.")
|
| 157 |
|
| 158 |
# TODO: I should reactivate this check
|
|
@@ -368,7 +368,7 @@ with demo:
|
|
| 368 |
value=CITATION_BUTTON_TEXT,
|
| 369 |
label=CITATION_BUTTON_LABEL,
|
| 370 |
elem_id="citation-button",
|
| 371 |
-
lines=
|
| 372 |
max_lines=10,
|
| 373 |
show_copy_button=True,
|
| 374 |
)
|
|
@@ -402,18 +402,22 @@ with demo:
|
|
| 402 |
gr.LoginButton()
|
| 403 |
submit_button = gr.Button("Submit Eval")
|
| 404 |
submission_result = gr.Markdown()
|
| 405 |
-
submit_button.click(
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
)
|
| 418 |
|
| 419 |
|
|
|
|
| 152 |
# Was the profile created less than 2 month ago?
|
| 153 |
user_data = requests.get(f"https://huggingface.co/api/users/{profile.username}/overview")
|
| 154 |
creation_date = json.loads(user_data.content)["createdAt"]
|
| 155 |
+
if datetime.datetime.now() - datetime.datetime.strptime(creation_date, '%Y-%m-%dT%H:%M:%S.%fZ') < datetime.timedelta(days=60):
|
| 156 |
return format_error("This account is not authorized to submit on this leaderboard.")
|
| 157 |
|
| 158 |
# TODO: I should reactivate this check
|
|
|
|
| 368 |
value=CITATION_BUTTON_TEXT,
|
| 369 |
label=CITATION_BUTTON_LABEL,
|
| 370 |
elem_id="citation-button",
|
| 371 |
+
lines=10,
|
| 372 |
max_lines=10,
|
| 373 |
show_copy_button=True,
|
| 374 |
)
|
|
|
|
| 402 |
gr.LoginButton()
|
| 403 |
submit_button = gr.Button("Submit Eval")
|
| 404 |
submission_result = gr.Markdown()
|
| 405 |
+
submit_button.submit.click(
|
| 406 |
+
fn=lambda: "⏳ Submitting...",
|
| 407 |
+
inputs=None,
|
| 408 |
+
outputs=status,
|
| 409 |
+
).then(
|
| 410 |
+
add_new_eval,
|
| 411 |
+
[
|
| 412 |
+
model_name_textbox,
|
| 413 |
+
model_family_textbox,
|
| 414 |
+
system_prompt_textbox,
|
| 415 |
+
url_textbox,
|
| 416 |
+
file_output,
|
| 417 |
+
organisation,
|
| 418 |
+
mail
|
| 419 |
+
],
|
| 420 |
+
submission_result,
|
| 421 |
)
|
| 422 |
|
| 423 |
|