Spaces:
Sleeping
Sleeping
Modify app.py to fix HF_TOKEN import bug
Browse files
app.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
-
from huggingface_hub import snapshot_download, hf_hub_download
|
| 2 |
-
import importlib.util
|
| 3 |
-
from pathlib import Path
|
| 4 |
import os
|
| 5 |
|
| 6 |
# 0. Immediately set the HF token from the secret
|
| 7 |
os.environ["HUGGINGFACE_TOKEN"] = os.getenv("HF_TOKEN")
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# 1. Download a snapshot of the private Space’s repo into a local cache directory
|
| 10 |
cache_dir = Path("private_space_cache")
|
| 11 |
cache_dir.mkdir(exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
# 0. Immediately set the HF token from the secret
|
| 4 |
os.environ["HUGGINGFACE_TOKEN"] = os.getenv("HF_TOKEN")
|
| 5 |
|
| 6 |
+
from huggingface_hub import snapshot_download, hf_hub_download
|
| 7 |
+
import importlib.util
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
|
| 10 |
# 1. Download a snapshot of the private Space’s repo into a local cache directory
|
| 11 |
cache_dir = Path("private_space_cache")
|
| 12 |
cache_dir.mkdir(exist_ok=True)
|