Spaces:
Running
Running
Commit
·
33f88d6
1
Parent(s):
441f3cf
Replace hf_hub_download with snapshot_download for improved submission repository access
Browse files- gradio_interface.py +6 -4
gradio_interface.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
from datetime import datetime, timezone, timedelta
|
| 4 |
-
from huggingface_hub import upload_file
|
| 5 |
-
from huggingface_hub import hf_hub_download
|
| 6 |
SUBMISSION_REPO = "SushantGautam/medvqa-submissions"
|
| 7 |
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
submissions = [
|
| 13 |
{"user": "User1", "task": "task1", "submitted_time": datetime.now() -
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
from datetime import datetime, timezone, timedelta
|
| 4 |
+
from huggingface_hub import upload_file, snapshot_download
|
|
|
|
| 5 |
SUBMISSION_REPO = "SushantGautam/medvqa-submissions"
|
| 6 |
|
| 7 |
|
| 8 |
+
def get_hub_path():
|
| 9 |
+
return snapshot_download(repo_id=SUBMISSION_REPO, allow_patterns=['*.json'])
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
print(f"{SUBMISSION_REPO} downloaded to {get_hub_path()}")
|
| 13 |
|
| 14 |
submissions = [
|
| 15 |
{"user": "User1", "task": "task1", "submitted_time": datetime.now() -
|