Spaces:
Runtime error
Runtime error
File size: 1,268 Bytes
25853a2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 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.")
|