| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| exec >> /root/chainA_after.log 2>&1 |
| echo "###################### CHAINE A demarree $(date -u '+%d/%m %H:%M UTC') ######################" |
|
|
| V=/root/venv/bin/python |
| REPO=Pricile/waxal2026-backup |
| ARPA=/scratch/lm/lin_5g.arpa |
| REC=/root/sub_SN3020.csv |
|
|
| up () { |
| $V -c " |
| from huggingface_hub import HfApi |
| import sys |
| HfApi(token=open('/root/.cache/huggingface/token').read().strip()).upload_file( |
| path_or_fileobj=sys.argv[1], path_in_repo=sys.argv[2], repo_id='$REPO', repo_type='model') |
| print(' -> HF ok', sys.argv[2])" "$1" "$2" || echo " !! upload HF echoue: $2" |
| } |
|
|
| exploite () { |
| NOM=$1; MOD=$2 |
| echo "--------------------------------------------------------------" |
| echo "### $NOM : $MOD $(date -u '+%H:%M')" |
| if [ ! -d "$MOD" ]; then echo " !! ABSENT, etape sautee"; return; fi |
|
|
| echo "--- (a) $NOM en PRIMAIRE (lingala redecode, shona repris du record)" |
| CKPT=$MOD BASE=$REC OUT=/root/sub_${NOM}P.csv ARPA=$ARPA \ |
| $V /root/gen_from_ckpt.py && up /root/sub_${NOM}P.csv phase2_corrected/sub_${NOM}P.csv \ |
| || echo " !! primaire $NOM echoue" |
|
|
| echo "--- (b) $NOM en JUGE lingala (par-dessus xlsr 1.0 + mms 1.0)" |
| BASE=$REC J3=$MOD W3S=0,0.5,1,2 TAG=${NOM}L \ |
| $V /root/lin_judge3.py || echo " !! juge lingala $NOM echoue" |
|
|
| echo "--- (c) $NOM en 4e JUGE shona (par-dessus sna_r2 6.0 + xlsr 4.0 + mms 2.0)" |
| BASE=$REC J4=$MOD W4S=0,1,2,4 TAG=${NOM}S \ |
| $V /root/sna_judge4.py || echo " !! juge shona $NOM echoue" |
| } |
|
|
| |
| echo "attente AfriHuBERT..." |
| while pgrep -f "[t]rain_ahb" > /dev/null; do sleep 60; done |
| echo "AfriHuBERT termine $(date -u '+%H:%M')" |
| sleep 20 |
| echo "--- eval finale AfriHuBERT :" |
| cat /scratch/runs/ahb/final_metrics.json 2>/dev/null | head -20 |
| echo "--- (rappel : champion = 0.2848 sur waxal_lin_validation)" |
|
|
| AHB=/scratch/runs/ahb/best |
| if [ ! -d "$AHB" ]; then |
| AHB=$(ls -1d /scratch/runs/ahb/checkpoint-* 2>/dev/null | sort -t- -k2 -n | tail -1) |
| echo "pas de dossier 'best', repli sur $AHB" |
| fi |
| exploite AHB "$AHB" |
|
|
| |
| echo "==============================================================" |
| echo "attente du checkpoint 'reconstruction' sur HF... $(date -u '+%H:%M')" |
| for i in $(seq 1 120); do |
| PRET=$($V -c " |
| from huggingface_hub import HfApi |
| f=HfApi().list_repo_files('$REPO') |
| print(1 if any(x.startswith('judges/rebuild_best/') and x.endswith('model.safetensors') for x in f) else 0)" 2>/dev/null) |
| [ "$PRET" = "1" ] && break |
| sleep 300 |
| done |
| if [ "$PRET" = "1" ]; then |
| echo "checkpoint reconstruction disponible, telechargement $(date -u '+%H:%M')" |
| $V -c " |
| from huggingface_hub import snapshot_download |
| snapshot_download(repo_id='$REPO', allow_patterns=['judges/rebuild_best/*'], |
| local_dir='/scratch/dl_rebuild') |
| print('telecharge')" |
| exploite RBL /scratch/dl_rebuild/judges/rebuild_best |
| else |
| echo "!! checkpoint reconstruction jamais arrive (10 h d attente) - etape sautee" |
| fi |
|
|
| |
| echo "==============================================================" |
| echo "### RECAP $(date -u '+%d/%m %H:%M UTC') : soumissions produites" |
| ls -la /root/sub_AHB*.csv /root/sub_RBL*.csv 2>/dev/null |
| echo "### rappel : record a battre = sub_SN3020.csv = 0.762373258" |
| echo "CHAINE_A_TERMINEE" |
|
|