Spaces:
Sleeping
Sleeping
Download deploy.py from k-l-lambda/speaking-midi: direct link, hf CLI and curl.
- Browser
- Download file 920 Bytes
-
https://huggingface.co/spaces/k-l-lambda/speaking-midi/resolve/main/deploy.py
- Command line
-
hf download hf://spaces/k-l-lambda/speaking-midi/deploy.py
-
curl -L -o deploy.py https://huggingface.co/spaces/k-l-lambda/speaking-midi/resolve/main/deploy.py
920 Bytes
| """Publish with HF_TOKEN or an existing Hugging Face login; never store tokens here.""" | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| if __name__ == '__main__': | |
| api = HfApi() | |
| repo = f"{api.whoami()['name']}/speaking-midi" | |
| api.create_repo(repo, repo_type='space', space_sdk='gradio', space_hardware='zero-a10g', exist_ok=True) | |
| api.add_space_variable(repo, 'INFERENCE_DEVICE', 'zerogpu') | |
| commit = api.upload_folder(repo_id=repo, repo_type='space', folder_path=Path(__file__).parent, | |
| allow_patterns=['app.py', 'player.py', 'ui/*', 'zero_tts.py', 'deploy.py', 'README.md', 'VALIDATION.md', 'requirements.txt', 'packages.txt', | |
| '.gitignore', 'speaking_midi/*.py', 'scripts/*.py', 'tests/*.py', | |
| 'assets/*', 'examples/**'], | |
| commit_message='Build CPU-capable Speaking MIDI audio and VoiceDesign demo') | |
| print(commit.commit_url) | |