File size: 905 Bytes
01f7932
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

CUDA='0'
EXP_ROOT="."

ckpt_list=('final')

for ckpt in "${ckpt_list[@]}"
do
    ckpt_path=$(printf '%s\n' ${EXP_ROOT}/${ckpt}-checkpoint | head -n 1)
    output_path="${ckpt_path}-merged"

    if [[ -d "$ckpt_path" ]]; then     # ckpt存在才执行下面
        # merge lora
        CUDA_VISIBLE_DEVICES=${CUDA} \
        swift export \
            --model "Qwen/Qwen3-VL-8B-Instruct" \
            --adapters ${ckpt_path} \
            --merge_lora true \
            --output_dir ${output_path}

        # inference
        CUDA_VISIBLE_DEVICES=${CUDA} \
        MAX_PIXELS=589824 \
        swift infer \
            --model ${output_path} \
            --stream true \
            --infer_backend pt \
            --temperature 0 \
            --max_new_tokens 8192 \
            --val_dataset "./track_1_test_swift_overallscore.json" \
            --result_path "./test_overall.json"

    fi
done