#!/bin/bash
#SBATCH --job-name=yollava
#SBATCH -q acc_ehpc
#SBATCH -A ehpc171
#SBATCH --nodes=1               # Number of nodes
#SBATCH --ntasks=1              # Number of tasks (usually, leave at 1)
#SBATCH --cpus-per-task=20      # CPU cores per task
#SBATCH -t 2:00:00
#SBATCH --gres=gpu:1
#SBATCH -o logs/yollava_rap_%A_%a.out
#SBATCH --array=0-39
# Array of sks_name values
source /gpfs/projects/ehpc171/ddas/envs/mini_cpm/bin/activate
export HF_HUB_OFFLINE=1
seed=$1
data='YoLLaVA'
concept_list_file="data/yollava-data/${data}_concept_list.txt"  # Precomputed file mapping indices to concepts
sks_entry=$(sed -n "$((SLURM_ARRAY_TASK_ID + 1))p" $concept_list_file)
category_name=$(echo $sks_entry | cut -d, -f1)
sks_name=$(echo $sks_entry | cut -d, -f2)
echo "Processing category: $category_name, concept: $sks_name"
python src/main.py --concept_name $sks_name --category_name $category_name \
--seed $seed --data_name $data --rerank_early --refined_k 3 --attribute_based_step_by_step --two_step --input_type text --only_recall --model_name mini_cpm \