Download upload_space.py from FincH12/Automation_Threads_EU: direct link, hf CLI and curl.
- Browser
- Download file 392 Bytes
-
https://huggingface.co/spaces/FincH12/Automation_Threads_EU/resolve/main/upload_space.py
- Command line
-
hf download hf://spaces/FincH12/Automation_Threads_EU/upload_space.py
-
curl -L -o upload_space.py https://huggingface.co/spaces/FincH12/Automation_Threads_EU/resolve/main/upload_space.py
392 Bytes
| import os | |
| from huggingface_hub import HfApi | |
| api = HfApi() | |
| new_space_id = "FincH12/Automation_Threads_EU" | |
| print("Uploading files...") | |
| api.upload_folder( | |
| folder_path=".", | |
| repo_id=new_space_id, | |
| repo_type="space", | |
| commit_message="Initial commit from local", | |
| ignore_patterns=[".git", ".git/*", "__pycache__", "__pycache__/*", "*.pyc"] | |
| ) | |
| print("Files uploaded successfully.") | |