| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| exec >> /root/chainB_after.log 2>&1 |
| echo "###################### CHAINE B demarree $(date -u '+%d/%m %H:%M UTC') ######################" |
|
|
| V=/root/venv/bin/python |
| REPO=Pricile/waxal2026-backup |
|
|
| echo "attente de la reconstruction..." |
| while pgrep -f "[t]rain_wbert" > /dev/null; do sleep 60; done |
| echo "reconstruction terminee $(date -u '+%H:%M')" |
| sleep 20 |
|
|
| echo "--- eval finale :" |
| cat /scratch/runs/rebuild/final_metrics.json 2>/dev/null | head -20 |
| echo "--- (rappel : champion = 0.2848)" |
| echo "--- trajectoire complete :" |
| tr "\r" "\n" < /root/chainB.log | grep -aoE "eval_combine.: .[0-9.]+" | tail -20 |
|
|
| BEST=/scratch/runs/rebuild/best |
| if [ ! -d "$BEST" ]; then |
| BEST=$(ls -1d /scratch/runs/rebuild/checkpoint-* 2>/dev/null | sort -t- -k2 -n | tail -1) |
| echo "pas de dossier 'best', repli sur $BEST" |
| fi |
| echo "checkpoint retenu : $BEST" |
| du -sh "$BEST" 2>/dev/null |
|
|
| |
| $V -c " |
| from huggingface_hub import HfApi |
| import sys |
| HfApi(token=open('/root/.cache/huggingface/token').read().strip()).upload_folder( |
| folder_path=sys.argv[1], path_in_repo='judges/rebuild_best', repo_id='$REPO', |
| repo_type='model', ignore_patterns=['optimizer.pt','rng_state.pth','scheduler.pt']) |
| print('RECONSTRUCTION_PUBLIEE_SUR_HF')" "$BEST" || echo "!! publication HF echouee" |
|
|
| echo "CHAINE_B_TERMINEE $(date -u '+%H:%M')" |
|
|