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.")