Download scripts/sync_space.py from mattbitzesty/pino-source-code: direct link, hf CLI and curl.
- Browser
- Download file 638 Bytes
-
https://huggingface.co/mattbitzesty/pino-source-code/resolve/e5ed910db3fc2e9023d818084e530294149c7abf/scripts/sync_space.py
- Command line
-
hf download hf://mattbitzesty/pino-source-code@e5ed910db3fc2e9023d818084e530294149c7abf/scripts/sync_space.py
-
curl -L -o sync_space.py https://huggingface.co/mattbitzesty/pino-source-code/resolve/e5ed910db3fc2e9023d818084e530294149c7abf/scripts/sync_space.py
638 Bytes
| from __future__ import annotations | |
| import os | |
| from huggingface_hub import HfApi | |
| def push_training_code_to_space() -> None: | |
| """Upload the local train_hf.py to the remote pino-pimt-training Space.""" | |
| token = os.environ.get("HF_TOKEN") | |
| api = HfApi(token=token) | |
| print("Pushing updated train_hf.py to the cloud Space...") | |
| api.upload_file( | |
| path_or_fileobj="src/pino/train_hf.py", | |
| path_in_repo="train.py", | |
| repo_id="mattbitzesty/pino-pimt-training", | |
| repo_type="space", | |
| ) | |
| print("Cloud Space synchronized successfully.") | |
| if __name__ == "__main__": | |
| push_training_code_to_space() | |