File size: 638 Bytes
31ee18f 14a2d75 31ee18f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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()
|