Spaces:
Build error
Build error
create download py
Browse files- download_model.py +18 -0
download_model.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import hf_hub_download
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
# This script runs ONCE during the Docker build
|
| 5 |
+
print("Starting model download...")
|
| 6 |
+
|
| 7 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 8 |
+
|
| 9 |
+
hf_hub_download(
|
| 10 |
+
repo_id="mradermacher/prem-1B-SQL-GGUF",
|
| 11 |
+
filename="prem-1B-SQL.Q8_0.gguf",
|
| 12 |
+
token=HF_TOKEN,
|
| 13 |
+
local_dir=".",
|
| 14 |
+
local_dir_use_symlinks=False,
|
| 15 |
+
local_path_and_filename="prem-1B-SQL.Q8_0.gguf"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
print("Model download complete.")
|