File size: 1,156 Bytes
025ab09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
# Tiny LoRA run on a SYNTHETIC dataset: train -> adapter -> load / merge -> evaluate (pipeline check).
#   bash examples/lora_tiny.sh [MODEL] [WORKDIR]
set -euo pipefail
cd "$(dirname "$0")/.."
MODEL=${1:-koreashin/simcheongi}
WORK=${2:-./_tiny_runs}
DEVICE=${DEVICE:-cuda}
python tools/make_fake_dataset.py --out "$WORK/fake_bc" --episodes 4 --decisions 12 --val-episodes 1
python train_lora.py --init "$MODEL" --data "$WORK/fake_bc" --out "$WORK/lora_tiny" --device "$DEVICE" \
    --steps 20 --batch 2 --lr 2e-4 --warmup 2 --workers 2 --log-every 1 --save-every 0 --keep-every 0 \
    --lora-rank 16 --lora-alpha 16
python merge_lora.py --base "$MODEL" --adapter "$WORK/lora_tiny/final" --out "$WORK/lora_tiny_merged"
python eval_offline.py --model "$MODEL" --data "$WORK/fake_bc" --split train --device "$DEVICE"
python eval_offline.py --model "$MODEL" --adapter "$WORK/lora_tiny/final" --data "$WORK/fake_bc" --split train --device "$DEVICE"
python eval_offline.py --model "$WORK/lora_tiny_merged" --data "$WORK/fake_bc" --split train --device "$DEVICE"
echo "adapter: $WORK/lora_tiny/final   merged model: $WORK/lora_tiny_merged"