Spaces:
Runtime error
Runtime error
Download hf_upload_fix.py from happynickamazon/zenvolt-api: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/happynickamazon/zenvolt-api/resolve/main/hf_upload_fix.py
- Command line
-
hf download hf://spaces/happynickamazon/zenvolt-api/hf_upload_fix.py
-
curl -L -o hf_upload_fix.py https://huggingface.co/spaces/happynickamazon/zenvolt-api/resolve/main/hf_upload_fix.py
1.27 kB
| from huggingface_hub import HfApi | |
| import os | |
| # Your Space Details | |
| repo_id = "happynickamazon/zenvolt-api" | |
| local_folder = "." # Current folder (inside proofstack) | |
| # Instructions: | |
| # 1. Open your terminal in the 'proofstack' folder. | |
| # 2. Run: python hf_upload_fix.py | |
| # 3. Enter your Access Token when prompted. | |
| print(f"π Starting professional upload to Space: {repo_id}") | |
| print("π This will correctly upload all subfolders (models/, data/, etc.) and large models.") | |
| token = input("π Please enter your Hugging Face Access Token (Write permission required): ") | |
| api = HfApi() | |
| try: | |
| api.upload_folder( | |
| folder_path=local_folder, | |
| repo_id=repo_id, | |
| repo_type="space", | |
| token=token, | |
| ignore_patterns=[ | |
| "data/raw_nasa/*", | |
| "data/processed/*", | |
| "**/*.log", | |
| "*.db", | |
| "*.sqlite", | |
| "__pycache__/*", | |
| "venv/*", | |
| ".git/*" | |
| ] | |
| ) | |
| print("\nβ SUCCESS! Everything has been uploaded correctly.") | |
| print("π Your Space is now building. Check your browser to see the green light.") | |
| except Exception as e: | |
| print(f"\nβ UPLOAD FAILED: {str(e)}") | |
| print("Tip: Ensure your token has 'Write' or 'Manage' permissions.") | |