Spaces:
Runtime error
Runtime error
File size: 637 Bytes
7d8b255 2d0e5f1 7d8b255 ee4c356 2d0e5f1 5c68b0e ee4c356 7d8b255 2d0e5f1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import os
from huggingface_hub import HfApi
api = HfApi(token=os.environ["sc4sc_token"])
# Step 1: Explicitly create the Space with SDK = "docker"
api.create_repo(
repo_id="sc4sc/editor", # Your org/username and repo name
repo_type="space",
space_sdk="docker",
private=False, # Set to True if you want it private
exist_ok=True # Avoid error if it already exists
)
# Step 2: Upload the contents
api.upload_large_folder(
folder_path=".",
repo_id="sc4sc/editor",
repo_type="space",
allow_patterns="**/*"
)
print("✅ Large folder upload completed successfully.")
|