Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
feat: add the local mode
Browse files
app.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from apscheduler.schedulers.background import BackgroundScheduler
|
| 3 |
from huggingface_hub import snapshot_download
|
|
@@ -10,7 +12,7 @@ from src.benchmarks import (
|
|
| 10 |
LongDocBenchmarks
|
| 11 |
)
|
| 12 |
from src.display.css_html_js import custom_css
|
| 13 |
-
from src.display.
|
| 14 |
get_version_dropdown,
|
| 15 |
get_search_bar,
|
| 16 |
get_reranking_dropdown,
|
|
@@ -42,10 +44,12 @@ def restart_space():
|
|
| 42 |
|
| 43 |
|
| 44 |
try:
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
except Exception as e:
|
| 50 |
print(f'failed to download')
|
| 51 |
restart_space()
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
| 5 |
from huggingface_hub import snapshot_download
|
|
|
|
| 12 |
LongDocBenchmarks
|
| 13 |
)
|
| 14 |
from src.display.css_html_js import custom_css
|
| 15 |
+
from src.display.components import (
|
| 16 |
get_version_dropdown,
|
| 17 |
get_search_bar,
|
| 18 |
get_reranking_dropdown,
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
try:
|
| 47 |
+
if not os.environ.get("LOCAL_MODE", False):
|
| 48 |
+
print("Running in local mode")
|
| 49 |
+
snapshot_download(
|
| 50 |
+
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30,
|
| 51 |
+
token=TOKEN
|
| 52 |
+
)
|
| 53 |
except Exception as e:
|
| 54 |
print(f'failed to download')
|
| 55 |
restart_space()
|
src/display/{gradio_formatting.py → components.py}
RENAMED
|
File without changes
|