Download push_dockerfile.py from whoisscaramouchee/textparser-backend: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/spaces/whoisscaramouchee/textparser-backend/resolve/main/push_dockerfile.py
- Command line
-
hf download hf://spaces/whoisscaramouchee/textparser-backend/push_dockerfile.py
-
curl -L -o push_dockerfile.py https://huggingface.co/spaces/whoisscaramouchee/textparser-backend/resolve/main/push_dockerfile.py
505 Bytes
| from huggingface_hub import HfApi, CommitOperationAdd | |
| TOKEN = "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" | |
| REPO = "whoisscaramouchee/textparser-backend" | |
| api = HfApi(token=TOKEN) | |
| with open("C:/Projects/.ut/hf-deploy/Dockerfile", "rb") as f: | |
| content = f.read() | |
| print(content.decode()) | |
| api.create_commit( | |
| repo_id=REPO, | |
| repo_type="space", | |
| operations=[CommitOperationAdd(path_in_repo="Dockerfile", path_or_fileobj=content)], | |
| commit_message="Fix: port 7860 for HF Spaces" | |
| ) | |
| print("\nDone!") | |