Dynavera/download_model.py

27 lines
848 B
Python
Raw Permalink Normal View History

import os
2026-03-18 01:04:34 +00:00
import logging
from huggingface_hub import hf_hub_download
REPO_ID = "Bartowski/Meta-Llama-3.1-8B-Instruct-GGUF"
FILENAME = "Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf"
LOCAL_DIR = "models"
2026-03-18 01:04:34 +00:00
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
def download_model():
2026-03-18 01:04:34 +00:00
logging.info(f"Starting download of {FILENAME}...")
logging.info(f"Destination: {os.path.abspath(LOCAL_DIR)}")
try:
path = hf_hub_download(
repo_id=REPO_ID,
filename=FILENAME,
local_dir=LOCAL_DIR,
)
2026-03-18 01:04:34 +00:00
logging.info(f"Model downloaded to: {path}")
logging.info(f"Expected size: ~4.92 GB")
except Exception as e:
2026-03-18 01:04:34 +00:00
logging.error(f"Error downloading model: {e}")
if __name__ == "__main__":
os.makedirs(LOCAL_DIR, exist_ok=True)
download_model()