Download scale/script/reference_backup_live.py from Tinghong-Ye22/code-Movens-Zero_train: direct link, hf CLI and curl.
- Browser
- Download file 655 Bytes
-
https://huggingface.co/Tinghong-Ye22/code-Movens-Zero_train/resolve/main/scale/script/reference_backup_live.py
- Command line
-
hf download hf://Tinghong-Ye22/code-Movens-Zero_train/scale/script/reference_backup_live.py
-
curl -L -o reference_backup_live.py https://huggingface.co/Tinghong-Ye22/code-Movens-Zero_train/resolve/main/scale/script/reference_backup_live.py
655 Bytes
| """Repair live-log backup without interrupting the existing training process.""" | |
| import fcntl | |
| import time | |
| import train_reference_baseline_fresh as run | |
| if __name__=='__main__': | |
| with (run.LOCAL/'backup_live.lock').open('a') as lock: | |
| fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB) | |
| while True: | |
| try: | |
| run.backup_once() | |
| except Exception as exc: | |
| value=dict(error=repr(exc),time=time.time()) | |
| else: | |
| value=dict(status='ok',time=time.time(),owner='reference_backup_live') | |
| run.save(run.LOCAL/'backup_live_status.json',value) | |
| time.sleep(60) | |