-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathrun_subject_wise_inference.sh
More file actions
49 lines (42 loc) · 1.9 KB
/
run_subject_wise_inference.sh
File metadata and controls
49 lines (42 loc) · 1.9 KB
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
#!/bin/bash
# List of subject IDs
subjects=(1 2 3 4 5 6)
# List of LLMs
#llms=("mistralai/Mistral-7B-Instruct-v0.3" "meta-llama/Meta-Llama-3-8B-Instruct" "Qwen/Qwen2.5-7B-Instruct")
llms=("$1")
# Loop over each LLM
echo -e "Normal models"
for llm in "${llms[@]}"; do
llm_name=$(echo "$llm" | awk -F '/' '{print $2}')
# Loop over each subject ID
for subject in "${subjects[@]}"; do
# Define model path and results CSV based on the LLM and subject ID
model_path="subject_wise/${llm_name}_subject-${subject}"
results_csv="results/results_${llm_name}_subject-${subject}.csv"
# Execute the python inference command
python inference.py --model_path "$model_path" \
--eeg_dataset data/block/eeg_55_95_std.pth \
--image_dir data/images/ \
--dest "$results_csv" \
--splits_path data/block/block_splits_by_image_single.pth \
--subject "$subject"
done
done
echo -e "No-stage2 models"
for llm in "${llms[@]}"; do
llm_name=$(echo "$llm" | awk -F '/' '{print $2}')
# Loop over each subject ID
for subject in "${subjects[@]}"; do
# Define model path and results CSV based on the LLM and subject ID
model_path="subject_wise/${llm_name}_no_stage2-subject-${subject}"
echo $model_path
results_csv="results/results_${llm_name}_no_stage2-subject-${subject}.csv"
# Execute the python inference command
python inference.py --model_path "$model_path" \
--eeg_dataset data/block/eeg_55_95_std.pth \
--image_dir data/images/ \
--dest "$results_csv" \
--splits_path data/block/block_splits_by_image_single.pth \
--subject "$subject"
done
done