File size: 1,632 Bytes
a88e206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
#SBATCH --qos=regular
#SBATCH --job-name=xnli_gemmainstruct27
#SBATCH --cpus-per-task=4
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --mem=64GB
#SBATCH --gres=gpu:4
#SBATCH --constraint=a100-sxm4
#SBATCH --output=/scratch/jbengoetxea/phd/XNLIvar/scripts/generative/logs/xnli_gemmainstruct27_%a.log
#SBATCH --error=/scratch/jbengoetxea/phd/XNLIvar/scripts/generative/logs/xnli_gemmainstruct27_%a.err
#SBATCH --time=01:00:00 #ee-hh:mm:ss
#SBATCH --mail-type=REQUEUE
#SBATCH --mail-user=jaione.bengoetxea@ehu.eus   
#SBATCH --array=0-8%2

source /scratch/jbengoetxea/phd/.gemma_env/bin/activate

export TRANSFORMERS_CACHE="/scratch/jbengoetxea/.cache"

# Values for the 2 loops:
# DATASET_VALUES=(xnli-eu-var xnli-eu-native xnli-eu xnli-es-var xnli-es-native xnli-es)  
# PROMPT_TYPE_VALUES=(chain nli-zero nli-few qa-zero qa-few)         


DATASET_VALUES=(xnli-eu-biz xnli-eu-gip xnli-eu-naf)  
PROMPT_TYPE_VALUES=(chain nli-zero nli-few)


N=${#PROMPT_TYPE_VALUES[@]}  # Number of items in the second level (VALUES2)

# Decode SLURM_ARRAY_TASK_ID to get the two indices
IDX1=$((SLURM_ARRAY_TASK_ID / N))
IDX2=$((SLURM_ARRAY_TASK_ID % N))

# Use IDX1 and IDX2 for your two-level loops
DATASET="${DATASET_VALUES[${IDX1}]}"
PROMPT_TYPE="${PROMPT_TYPE_VALUES[${IDX2}]}"


TASK=trilabel
MODEL=gemmainstruct27
OUTPUT=/scratch/jbengoetxea/phd/XNLIvar/scripts/generative/results/$DATASET/$MODEL

python3 /scratch/jbengoetxea/phd/XNLIvar/scripts/generative/scripts/zero_shot.py \
    --dataset "${DATASET}" \
    --model $MODEL \
    --output_dir $OUTPUT \
    --task $TASK \
    --prompt_type "${PROMPT_TYPE}"