# set conda
source scripts/env.sh
conda activate libero

ckpts_paths=(
    outputs/pi0/2025-04-07/19-18-59_pi0_liberos_ck50_gpu8_lr1e-4_bs16_s800k/checkpoints/060000/pretrained_model
    outputs/fast/2025-04-07/19-05-34_pi0fast_liberos_ck10_gpu8_lr1e-4_bs16_s800k/checkpoints/060000/pretrained_model
)   

task_suite_names=(
    libero_spatial
    libero_object
    # libero_goal
    # libero_10
)

model_names=(
    pi0
    pi0fast
)

replan_steps=10
for i in ${!ckpts_paths[@]}; do
    ckpt_path=${ckpts_paths[$i]}
    task_suite_name=${task_suite_names[$i]}
    model_name=${model_names[$i]}
    job_name=$(echo $ckpt_path | sed 's|^outputs/${model_name}/||' | sed 's|/|_|g' | sed 's|_pretrained_model||')
    
    echo "🎃$ckpt_path"
    echo $job_name ...
    cuda=$((i % 4))
    # CUDA_VISIBLE_DEVICES=${cuda} python test/eval_libero.py \
    
    tmux new-session -d -s ${cuda}_${job_name} "CUDA_VISIBLE_DEVICES=0 python test/eval_libero.py \
        --args.pretrained-path $ckpt_path \
        --args.task-suite-name ${task_suite_name} \
        --args.job-name ${job_name} \
        --args.num-trials-per-task 10 \
        --args.replan-steps ${replan_steps} \
        --args.model-name ${model_name}"
done