Cleaned up model download script
This commit is contained in:
parent
20ac7f471c
commit
9085de6732
1 changed files with 8 additions and 6 deletions
|
|
@ -1,24 +1,26 @@
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
from huggingface_hub import hf_hub_download
|
from huggingface_hub import hf_hub_download
|
||||||
|
|
||||||
REPO_ID = "Bartowski/Meta-Llama-3.1-8B-Instruct-GGUF"
|
REPO_ID = "Bartowski/Meta-Llama-3.1-8B-Instruct-GGUF"
|
||||||
FILENAME = "Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf"
|
FILENAME = "Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf"
|
||||||
LOCAL_DIR = "models"
|
LOCAL_DIR = "models"
|
||||||
|
|
||||||
def download_model():
|
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
||||||
print(f"🚀 Starting download of {FILENAME}...")
|
|
||||||
print(f"📂 Destination: {os.path.abspath(LOCAL_DIR)}")
|
|
||||||
|
|
||||||
|
def download_model():
|
||||||
|
logging.info(f"Starting download of {FILENAME}...")
|
||||||
|
logging.info(f"Destination: {os.path.abspath(LOCAL_DIR)}")
|
||||||
try:
|
try:
|
||||||
path = hf_hub_download(
|
path = hf_hub_download(
|
||||||
repo_id=REPO_ID,
|
repo_id=REPO_ID,
|
||||||
filename=FILENAME,
|
filename=FILENAME,
|
||||||
local_dir=LOCAL_DIR,
|
local_dir=LOCAL_DIR,
|
||||||
)
|
)
|
||||||
print(f"Model downloaded to: {path}")
|
logging.info(f"Model downloaded to: {path}")
|
||||||
print(f"Expected size: ~4.92 GB")
|
logging.info(f"Expected size: ~4.92 GB")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error downloading model: {e}")
|
logging.error(f"Error downloading model: {e}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.makedirs(LOCAL_DIR, exist_ok=True)
|
os.makedirs(LOCAL_DIR, exist_ok=True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue