Spaces:
Sleeping
Sleeping
Update download_model.py
Browse files- download_model.py +15 -5
download_model.py
CHANGED
|
@@ -1,8 +1,18 @@
|
|
| 1 |
-
from huggingface_hub import hf_hub_download
|
| 2 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
repo_id =
|
| 5 |
-
filename =
|
| 6 |
|
| 7 |
-
|
| 8 |
-
hf_hub_download(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
from huggingface_hub import hf_hub_download
|
| 3 |
+
|
| 4 |
+
# Force writable cache path
|
| 5 |
+
os.environ["HF_HOME"] = "/tmp/hf_cache"
|
| 6 |
+
os.environ["HF_HUB_CACHE"] = "/tmp/hf_cache"
|
| 7 |
|
| 8 |
+
repo_id = "TheBloke/phi-2-GGUF"
|
| 9 |
+
filename = "phi-2.Q4_K_M.gguf"
|
| 10 |
|
| 11 |
+
# Download to current working dir
|
| 12 |
+
hf_hub_download(
|
| 13 |
+
repo_id=repo_id,
|
| 14 |
+
filename=filename,
|
| 15 |
+
cache_dir="/tmp/hf_cache", # override .cache
|
| 16 |
+
local_dir=".",
|
| 17 |
+
local_dir_use_symlinks=False
|
| 18 |
+
)
|