CoolFace
Modelpublic

zaher-m/stanceeval2026

sourceHugging Faceupdated 1mo agoView on Hugging Face
0likes
README.md70 linesDownload Raw Back to code
1# Code2 3The pipeline that produces predictions from the released models, for StanceEval-2026 Track 1 (seen4targets) and Track 2 (unseen targets). Base LLMs are fetched from their own Hugging Face repos.5 6```bash7pip install -r ../requirements.txt8```9 10## Prediction11 121. Encoder ensemble, averaged softmax over the fine-tuned encoders:13   ```bash14   python -m src.predict --models <MODEL_DIRS> --csv <test.csv> --out preds_enc.txt15   ```162. Retrieval few-shot LLM, with MARBERTv2-retrieved shots over a served instruction model on an17   OpenAI-compatible endpoint:18   ```bash19   export AUG_BASE_URL="http://localhost:8017/v1"; export AUG_MODEL="LilaRest/gemma-4-31B-it-NVFP4-turbo"20   python -m src.llm_classify --csv <test.csv> --train <pool.csv> --retrieve \21       --embed_model UBC-NLP/MARBERTv2 --shots 6 --n 6 --mode direct \22       --out_probs gemma.npy --base_url "$AUG_BASE_URL" --model "$AUG_MODEL"23   ```243. LoRA member, scored by label log-probability:25   ```bash26   python -m src.llm_infer --adapter <lora_dir> --base_model ALLaM-AI/ALLaM-7B-Instruct-preview \27       --csv <test.csv> --out_probs allam.npy28   ```294. Blend and None calibration, then labels:30   ```bash31   python -m src.blend_tune --csv <test.csv> --models <MODEL_DIRS> --enc_weight 0.45 \32       --llm_probs gemma.npy allam.npy --llm_weights 0.5 0.5 --none_bias 0.0 --out pred.txt33   ```34 35The final label decision uses the plug-in rule for *F*<sub>avg2</sub>: claim class *c* when *P*(*c*)36exceeds *F*<sub>c</sub>/2, otherwise fall back to `None`.37 38## Training39 40Encoders are config-driven, and the full config also lands in each model's `best.json`:41 42```bash43python -m src.train --config configs/track{1,2}.yaml --overrides model_hf=<id>,out_dir=<dir>44python -m src.train --config configs/track2_aug.yaml        # uses data/track2/train_aug.csv45```46 47LoRA adapters (r=16, α=32, base fetched from HF):48 49```bash50python -m src.llm_finetune --train_csv <train.csv> \51    --base_model ALLaM-AI/ALLaM-7B-Instruct-preview --out_dir outputs/allam_t2 \52    --epochs 3 --batch_size 16 --save_every 1553```54 55The generated pools in `../data/` come from `src/gen_synth.py` (style and target-matched shots) and56`src/augment.py` (paraphrase augmentation). See [`../data/README.md`](../data/README.md).57 58## Rebuilding an auxiliary encoder59 60Four encoders were used only as probability sources and never saved. Override the base id to rebuild61them, for example AraELECTRA:62 63```bash64python -m src.train --config configs/track1.yaml \65    --overrides model_hf=aubmindlab/araelectra-base-discriminator,out_dir=outputs/t1_araelectra66```67 68The same pattern rebuilds the XLM-R-large, ARBERTv2 and AraBERT-large members. Encoder label order is69`["Against","Favor","None"]`, set in `src/data.py`.70