File size: 520 Bytes
7d8b255
4f1ce0d
7d8b255
2d0e5f1
7d8b255
4a93fbd
ee4c356
4f1ce0d
ee4c356
4a93fbd
4f1ce0d
 
ee4c356
 
4a93fbd
2d0e5f1
 
 
5c68b0e
ee4c356
7d8b255
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from huggingface_hub import HfApi
import os

api = HfApi(token=os.environ["sc4sc_token"])

# ✅ スペースを先に作成(これが重要!)
api.create_repo(
    repo_id="sc4sc/editor",
    repo_type="space",
    space_sdk="docker",  # ← 'gradio', 'streamlit', 'docker', 'static' のどれかを必ず指定
    private=False,
    exist_ok=True
)

# ✅ その後にアップロード
api.upload_large_folder(
    folder_path=".",
    repo_id="sc4sc/editor",
    repo_type="space",
    allow_patterns="**/*"
)