Spaces:
Running
Running
Commit
·
716f5a5
1
Parent(s):
929f324
Update whoami function call to print account token and fix timezone handling in submission time validation
Browse files- gradio_interface.py +3 -2
gradio_interface.py
CHANGED
|
@@ -6,7 +6,7 @@ import shutil
|
|
| 6 |
import os
|
| 7 |
from pathlib import Path
|
| 8 |
from huggingface_hub import whoami
|
| 9 |
-
|
| 10 |
|
| 11 |
SUBMISSION_REPO = "SushantGautam/medvqa-submissions"
|
| 12 |
hub_dir = None
|
|
@@ -142,7 +142,8 @@ def add_submission(file):
|
|
| 142 |
int(sub_timestamp) / 1000, tz=timezone.utc)
|
| 143 |
assert task in ["task1", "task2"], "Invalid task type"
|
| 144 |
assert len(username) > 0, "Invalid username"
|
| 145 |
-
assert submission_time < datetime.now(
|
|
|
|
| 146 |
print("Adding submission...", username, task, submission_time)
|
| 147 |
upload_file(
|
| 148 |
path_or_fileobj=file,
|
|
|
|
| 6 |
import os
|
| 7 |
from pathlib import Path
|
| 8 |
from huggingface_hub import whoami
|
| 9 |
+
print("Account token used to connect to HuggingFace: ", whoami()['name'])
|
| 10 |
|
| 11 |
SUBMISSION_REPO = "SushantGautam/medvqa-submissions"
|
| 12 |
hub_dir = None
|
|
|
|
| 142 |
int(sub_timestamp) / 1000, tz=timezone.utc)
|
| 143 |
assert task in ["task1", "task2"], "Invalid task type"
|
| 144 |
assert len(username) > 0, "Invalid username"
|
| 145 |
+
assert submission_time < datetime.now(
|
| 146 |
+
timezone.utc), "Invalid submission time"
|
| 147 |
print("Adding submission...", username, task, submission_time)
|
| 148 |
upload_file(
|
| 149 |
path_or_fileobj=file,
|