Ai-ToolStack / app /utils /model_loader.py
teja141290's picture
Update: Remove damage model and add Docker configuration
98bf2c9
raw
history blame
457 Bytes
import os
from huggingface_hub import hf_hub_download
def download_model_from_hub(repo_id, filename):
"""Download model from Hugging Face Hub"""
return hf_hub_download(
repo_id=repo_id,
filename=filename,
token=os.getenv("HF_TOKEN") # Optional: if models are private
)
# Model paths
PARTS_MODEL_PATH = download_model_from_hub(
"AItoolstack/car_damage_detection",
"yolov8_models/parts/weights/weights/best.pt"
)