s4s-editor-beta / upload.py
soiz1's picture
Update upload.py
4a93fbd verified
raw
history blame
520 Bytes
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="**/*"
)