Upload variant_a/scripts/auto_chain.sh with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778#!/bin/bashexport PATH=/venv/main/bin:/usr/local/bin:/usr/bin:/binexport PYTHONDONTWRITEBYTECODE=1export CUDA_VISIBLE_DEVICES=0export WORK=/dev/shm/evalexport QUIP_DIR=$WORK/quip-sharpexport HF_DATASETS_TRUST_REMOTE_CODE=1export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
# 1. Wait for MC run (PID 9529) to finishlog "Waiting for MC run (PID 9529) to finish..."while ps -p 9529 > /dev/null 2>&1; do sleep 60donelog "MC run finished!"
# 2. Print MC resultslog "============================================"log " MC RESULTS"log "============================================"python3 $WORK/print_results.py $WORK/results_mc/full_results.json 2>&1 || log "MC results not found"
# 3. Run generative tasks (with optimized generate: max_gen_toks=64, newline stop)log "============================================"log " STARTING: Generative core tasks (6 regex)"log "============================================"cd $WORK/lm-evaluation-harness
python $WORK/eval_polish_quip.py \ --model_path $WORK/model \ --tokenizer speakleash/Bielik-11B-v2.3-Instruct \ --output_dir $WORK/results_gen \ --num_fewshot 5 \ --batch_size 8 \ --tasks polemo2_in polemo2_out polish_8tags_regex polish_cbd_regex \ polish_ppc_regex polish_psc_regex \ 2>&1
log "Generative tasks done!"log "============================================"log " GENERATIVE RESULTS"log "============================================"python3 $WORK/print_results.py $WORK/results_gen/full_results.json 2>&1 || log "Gen results not found"
# 4. Run remaining taskslog "============================================"log " STARTING: Remaining tasks (13)"log "============================================"
python $WORK/eval_polish_quip.py \ --model_path $WORK/model \ --tokenizer speakleash/Bielik-11B-v2.3-Instruct \ --output_dir $WORK/results_remaining \ --num_fewshot 5 \ --batch_size 8 \ --tasks polish_belebele_mc polish_belebele_regex \ polish_dyk_multiple_choice polish_dyk_regex \ polish_klej_ner_multiple_choice polish_klej_ner_regex \ polish_polqa_reranking_multiple_choice polish_polqa_open_book polish_polqa_closed_book \ polish_poquad_open_book \ polish_eq_bench polish_eq_bench_first_turn \ polish_poleval2018_task3_test_10k \ 2>&1
log "Remaining tasks done!"log "============================================"log " REMAINING RESULTS"log "============================================"python3 $WORK/print_results.py $WORK/results_remaining/full_results.json 2>&1 || log "Remaining results not found"
log "============================================"log " ALL COMPLETE"log "============================================"log "MC: $WORK/results_mc/full_results.json"log "Generative:$WORK/results_gen/full_results.json"log "Remaining: $WORK/results_remaining/full_results.json"variant_a/scripts/auto_chain.shAdded+78