Spaces:
Sleeping
Sleeping
Download push.py from snow2357/tts-server: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/snow2357/tts-server/resolve/main/push.py
- Command line
-
hf download hf://spaces/snow2357/tts-server/push.py
-
curl -L -o push.py https://huggingface.co/spaces/snow2357/tts-server/resolve/main/push.py
1.12 kB
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| # Configuration | |
| REPO_ID = "snow2357/tts-server" # Your Hugging Face Space repo ID | |
| REPO_TYPE = "space" # Since this is a Space, type is "space" | |
| LOCAL_DIR = Path(__file__).resolve().parent | |
| def main(): | |
| print(f"Initializing Hugging Face API client...") | |
| api = HfApi() | |
| print(f"Preparing to upload folder '{LOCAL_DIR}' to Space '{REPO_ID}'...") | |
| # Upload the entire folder contents to the Space repository | |
| api.upload_folder( | |
| folder_path=str(LOCAL_DIR), | |
| repo_id=REPO_ID, | |
| repo_type=REPO_TYPE, | |
| ignore_patterns=[ | |
| "__pycache__/*", | |
| "*.pyc", | |
| ".git/*", | |
| ".venv/*", | |
| ".gradio/*", | |
| "outputs/*", | |
| ], # Ignores cache, virtual environments, and local temp audio outputs | |
| commit_message="Update TTS server backend and model weights via upload script", | |
| ) | |
| print( | |
| f"Successfully uploaded everything to https://huggingface.co/spaces/{REPO_ID}!" | |
| ) | |
| if __name__ == "__main__": | |
| main() | |