Jakubrd4 commited on
Commit
18ce00c
·
verified ·
1 Parent(s): 1a09fb2

Upload variant_a/scripts/auto_chain.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. variant_a/scripts/auto_chain.sh +78 -0
variant_a/scripts/auto_chain.sh ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ export PATH=/venv/main/bin:/usr/local/bin:/usr/bin:/bin
3
+ export PYTHONDONTWRITEBYTECODE=1
4
+ export CUDA_VISIBLE_DEVICES=0
5
+ export WORK=/dev/shm/eval
6
+ export QUIP_DIR=$WORK/quip-sharp
7
+ export HF_DATASETS_TRUST_REMOTE_CODE=1
8
+ export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
9
+
10
+ log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
11
+
12
+ # 1. Wait for MC run (PID 9529) to finish
13
+ log "Waiting for MC run (PID 9529) to finish..."
14
+ while ps -p 9529 > /dev/null 2>&1; do
15
+ sleep 60
16
+ done
17
+ log "MC run finished!"
18
+
19
+ # 2. Print MC results
20
+ log "============================================"
21
+ log " MC RESULTS"
22
+ log "============================================"
23
+ python3 $WORK/print_results.py $WORK/results_mc/full_results.json 2>&1 || log "MC results not found"
24
+
25
+ # 3. Run generative tasks (with optimized generate: max_gen_toks=64, newline stop)
26
+ log "============================================"
27
+ log " STARTING: Generative core tasks (6 regex)"
28
+ log "============================================"
29
+ cd $WORK/lm-evaluation-harness
30
+
31
+ python $WORK/eval_polish_quip.py \
32
+ --model_path $WORK/model \
33
+ --tokenizer speakleash/Bielik-11B-v2.3-Instruct \
34
+ --output_dir $WORK/results_gen \
35
+ --num_fewshot 5 \
36
+ --batch_size 8 \
37
+ --tasks polemo2_in polemo2_out polish_8tags_regex polish_cbd_regex \
38
+ polish_ppc_regex polish_psc_regex \
39
+ 2>&1
40
+
41
+ log "Generative tasks done!"
42
+ log "============================================"
43
+ log " GENERATIVE RESULTS"
44
+ log "============================================"
45
+ python3 $WORK/print_results.py $WORK/results_gen/full_results.json 2>&1 || log "Gen results not found"
46
+
47
+ # 4. Run remaining tasks
48
+ log "============================================"
49
+ log " STARTING: Remaining tasks (13)"
50
+ log "============================================"
51
+
52
+ python $WORK/eval_polish_quip.py \
53
+ --model_path $WORK/model \
54
+ --tokenizer speakleash/Bielik-11B-v2.3-Instruct \
55
+ --output_dir $WORK/results_remaining \
56
+ --num_fewshot 5 \
57
+ --batch_size 8 \
58
+ --tasks polish_belebele_mc polish_belebele_regex \
59
+ polish_dyk_multiple_choice polish_dyk_regex \
60
+ polish_klej_ner_multiple_choice polish_klej_ner_regex \
61
+ polish_polqa_reranking_multiple_choice polish_polqa_open_book polish_polqa_closed_book \
62
+ polish_poquad_open_book \
63
+ polish_eq_bench polish_eq_bench_first_turn \
64
+ polish_poleval2018_task3_test_10k \
65
+ 2>&1
66
+
67
+ log "Remaining tasks done!"
68
+ log "============================================"
69
+ log " REMAINING RESULTS"
70
+ log "============================================"
71
+ python3 $WORK/print_results.py $WORK/results_remaining/full_results.json 2>&1 || log "Remaining results not found"
72
+
73
+ log "============================================"
74
+ log " ALL COMPLETE"
75
+ log "============================================"
76
+ log "MC: $WORK/results_mc/full_results.json"
77
+ log "Generative:$WORK/results_gen/full_results.json"
78
+ log "Remaining: $WORK/results_remaining/full_results.json"