Spaces:
Running
Running
| 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" | |
| ) |