| # AfriHuBERT-xlarge : DERNIERE famille d encodeur reellement ouverte. | |
| # | |
| # Pourquoi la loi de memorisation ne s applique PAS ici : c est un HubertModel, | |
| # donc AUTO-SUPERVISE -- il a appris sur de l audio seul, sans jamais voir une | |
| # transcription. Meme s il a entendu de l audio WAXAL, il ne peut rien reciter. | |
| # Les deux modeles qui ont echoue (asr-africa, sulaimank) avaient une tete CTC | |
| # entrainee sur les TEXTES WAXAL : c est ca qui produisait la recitation. | |
| # | |
| # 48 couches / hidden 1280, contre 24 / 1024 pour notre base w2v-BERT 2.0, | |
| # et pre-entraine sur de la parole AFRICAINE. | |
| set -e | |
| export HF_TOKEN=REMPLACER_PAR_VOTRE_JETON_HF | |
| /root/venv/bin/python - <<PY | |
| from huggingface_hub import snapshot_download | |
| p=snapshot_download(repo_id="ajesujoba/AfriHuBERT-xlarge", local_dir="/scratch/models/afrihubert_xl") | |
| print("DL OK",p) | |
| import json | |
| c=json.load(open(p+"/config.json")) | |
| print("arch",c.get("architectures"),"hidden",c.get("hidden_size"),"couches",c.get("num_hidden_layers")) | |
| PY | |
| # pas de vocab externe : train_wbert doit reconstruire le NOTRE (casse+ponctuation) | |
| rm -f /scratch/models/afrihubert_xl/vocab.json /scratch/models/afrihubert_xl/tokenizer_config.json | |
| [ -f /scratch/models/afrihubert_xl/vocab.json ] && { echo "ERREUR vocab present"; exit 1; } | |
| M=/scratch/prep/manifests | |
| SAVE_LIMIT=12 LOAD_BEST=0 IGNORE_MISMATCH=1 /root/venv/bin/python /root/train_wbert.py \ | |
| --lang lin --out /scratch/runs/ahb \ | |
| --init /scratch/models/afrihubert_xl \ | |
| --train $M/waxal_lin_train.jsonl $M/waxal_sna_train.jsonl \ | |
| --eval $M/waxal_lin_validation.jsonl \ | |
| --lr 5e-5 --epochs 6 --bs 4 --grad_accum 15 --warmup 300 --eval_steps 200 | |
| echo AHB_TRAIN_DONE | |