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