Switch to per-file download
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from urllib.parse import quote
|
|
| 11 |
|
| 12 |
import gradio as gr
|
| 13 |
import pandas as pd
|
| 14 |
-
from huggingface_hub import HfApi,
|
| 15 |
|
| 16 |
from theme import FORCE_LIGHT_THEME_JS, POVISLE_THEME
|
| 17 |
from views import (
|
|
@@ -1592,15 +1592,15 @@ def refresh_results_from_hub(local_results_path: Path) -> None:
|
|
| 1592 |
)
|
| 1593 |
|
| 1594 |
local_results_path.mkdir(parents=True, exist_ok=True)
|
| 1595 |
-
|
| 1596 |
-
|
| 1597 |
-
|
| 1598 |
-
|
| 1599 |
-
|
| 1600 |
-
|
| 1601 |
-
|
| 1602 |
-
|
| 1603 |
-
|
| 1604 |
|
| 1605 |
|
| 1606 |
def resolve_results_dir() -> Path:
|
|
|
|
| 11 |
|
| 12 |
import gradio as gr
|
| 13 |
import pandas as pd
|
| 14 |
+
from huggingface_hub import HfApi, hf_hub_download
|
| 15 |
|
| 16 |
from theme import FORCE_LIGHT_THEME_JS, POVISLE_THEME
|
| 17 |
from views import (
|
|
|
|
| 1592 |
)
|
| 1593 |
|
| 1594 |
local_results_path.mkdir(parents=True, exist_ok=True)
|
| 1595 |
+
for filename in matched_files:
|
| 1596 |
+
hf_hub_download(
|
| 1597 |
+
repo_id=RESULTS_REPO,
|
| 1598 |
+
filename=filename,
|
| 1599 |
+
repo_type="dataset",
|
| 1600 |
+
local_dir=str(local_results_path),
|
| 1601 |
+
etag_timeout=30,
|
| 1602 |
+
token=HF_TOKEN,
|
| 1603 |
+
)
|
| 1604 |
|
| 1605 |
|
| 1606 |
def resolve_results_dir() -> Path:
|