Diamanta commited on
Commit
1e45192
·
verified ·
1 Parent(s): 75d98ed

Update download_model.py

Browse files
Files changed (1) hide show
  1. 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 = os.environ.get("MODEL_REPO")
5
- filename = os.environ.get("MODEL_FILE")
6
 
7
- print("Downloading model:", repo_id, filename)
8
- hf_hub_download(repo_id=repo_id, filename=filename, local_dir=".", local_dir_use_symlinks=False)
 
 
 
 
 
 
 
 
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
+ )