Portrait-Infer / infer_qwen3_level_final.sh
chris-123's picture
Upload 3 files
01f7932 verified
Raw
History Blame Contribute Delete
896 Bytes
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_level.json" \
--result_path "./test_level.json"
fi
done