Download train_space.py from Ian26/MarsLM: direct link, hf CLI and curl.
- Browser
- Download file 647 Bytes
-
https://huggingface.co/spaces/Ian26/MarsLM/resolve/main/train_space.py
- Command line
-
hf download hf://spaces/Ian26/MarsLM/train_space.py
-
curl -L -o train_space.py https://huggingface.co/spaces/Ian26/MarsLM/resolve/main/train_space.py
647 Bytes
| import os | |
| from huggingface_hub import HfApi, login | |
| print("Iniciando entrenamiento MarsLM") | |
| # Entrenar modelo | |
| os.system( | |
| "python training/train.py " | |
| "--config configs/marslm-300M.yaml " | |
| "--train-file artifacts/data/tokens.pt " | |
| "--tokenizer-model artifacts/tokenizer/marslm.json " | |
| "--output-dir artifacts/checkpoints " | |
| "--epochs 3 " | |
| "--batch-size 1 " | |
| "--gradient-accumulation-steps 4" | |
| ) | |
| print("Subiendo checkpoint a Hugging Face") | |
| api = HfApi() | |
| api.upload_folder( | |
| folder_path="artifacts/checkpoints", | |
| repo_id="Ian26/MarsLM", | |
| repo_type="model" | |
| ) | |
| print("MarsLM actualizado") |