#!/bin/bash

rlhf_v9_from_pretrained_64=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v9_from_pretrained_64_hf
rlhf_v9_from_pretrained_128=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v9_from_pretrained_128_hf
rlhf_v9_from_pretrained_192=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v9_from_pretrained_192_hf
rlhf_v9_from_pretrained_256=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v9_from_pretrained_256_hf
rlhf_v9_from_pretrained_320=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v9_from_pretrained_320_hf
models=($rlhf_v9_from_pretrained_64 $rlhf_v9_from_pretrained_128 $rlhf_v9_from_pretrained_192 $rlhf_v9_from_pretrained_256 $rlhf_v9_from_pretrained_320)

rlhf_v8_time_2_64=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v8_time_2_hf_64
rlhf_v8_time_2_96=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v8_time_2_hf_96
rlhf_v8_time_2_128=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v8_time_2_hf_128
rlhf_v8_time_2_160=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v8_time_2_hf_160
models=($rlhf_v8_time_2_64 $rlhf_v8_time_2_96 $rlhf_v8_time_2_128 $rlhf_v8_time_2_160)


#rlhf_v7_40_120=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240820_warmup_40_bsz_16_1_1_prompt_len_32768_policy_rm_v7_96_hf/
rlhf_v7_40_120=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240820_warmup_40_bsz_64_prompt_len_32768_policy_120_hf
rlhf_v7_relabel_64=/cpfs02/llm/shared/public/lantian/exp/transfer_from_tos/20240826_warmup_40_bsz_64_1_1_prompt_len_32768_rm_v7_relabel_64
models=($rlhf_v7_relabel_64)

for index in $(seq 0 0)
do
    model=${models[$index]}
    index=$(($index+1))

    if [[ $model == *"no_ref"* ]]; then
        # inference donot contain reference prompt
        reference=False
    else
        reference=True
    fi

    if [[ $model == *"no_criteria"* ]]; then
        # inference donot contain criteria prompt
        criteria=False
    else
        criteria=True
    fi

    if [[ $model == *"no_task"* ]]; then
        # inference donot contain task prompt
        task=False
    else
        task=True
    fi


    if [[ $model == *"no_all"* ]]; then
        # inference donot contain task prompt
        task=False
        criteria=False
        reference=False
    fi
    echo "Inference $model on GPU[$index] | task [$task] | criteria [$criteria] | reference [$reference]"
    CUDA_VISIBLE_DEVICES=$index python feedback_models.py --model_name $model --output_dir 20240823_rlhf_singleturn_temp_07 --reference $reference --task $task --criteria $criteria --split dev &
    #CUDA_VISIBLE_DEVICES=$(($index+1)) python feedback_models.py --model_name $model --output_dir 20240811_resumm_debug --reference $reference --task $task --criteria $criteria --split test &
done
