Spaces:
Paused
Paused
| #!/usr/bin/env python3 | |
| """Download model weights from HuggingFace model repository.""" | |
| import os | |
| from pathlib import Path | |
| # Always download weights from model repository | |
| repo = os.environ.get('FOUNDATIONPOSE_MODEL_REPO', 'gpue/foundationpose-weights') | |
| token = os.environ.get('HF_TOKEN') | |
| print(f'Downloading weights from {repo}...') | |
| try: | |
| from huggingface_hub import snapshot_download | |
| snapshot_download( | |
| repo_id=repo, | |
| local_dir='weights', | |
| token=token, | |
| repo_type='model' | |
| ) | |
| print('✓ Weights downloaded successfully') | |
| except Exception as e: | |
| print(f'✗ Weight download failed: {e}') | |
| raise | |