File size: 2,401 Bytes
ecadbd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# export SAMA_CONFIG=./config/sama_dr_lla13.yaml
export SAMA_CONFIG=./config/sama_dr_lla.yaml

export TOKENIZERS_PARALLELISM=true

# CUDA Include (/cuda.h)
CUDA_INCLUDE_PATH="/home/work/miniconda3/envs/allm/include"

export CPATH=$CPATH:$CUDA_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$CUDA_INCLUDE_PATH

export WANDB_PROJECT="SAMA_DROP"

date +"%F %T"

# python -m src.merge_and_eval_drop \
#     --config_path $SAMA_CONFIG --model.adapter_path Llama2_exps/DROP/t=30d20h51m30,mlr1.0e-03,b4,nb4,4,cL32,rR32,s1,initdef,dr0.0,ep2.0
#     # exps/DROP_FB/mlr=2.0e-03,b=4,nb=4,3,cL=12,rR=16,s=1,init=def,dr0.0,t=23d19h55m22

# python -m src.merge_and_eval_drop \
#     --config_path $SAMA_CONFIG --model.adapter_path Llama2_exps/DROP/t=30d21h26m00,mlr1.0e-03,b4,nb4,4,cL16,rR16,s1,initdef,dr0.0,ep2.0

# python -m src.merge_and_eval_drop \
#     --config_path $SAMA_CONFIG --model.adapter_path Llama2_exps/DROP/t=30d22h20m42,mlr1.0e-03,b4,nb4,4,cL16,rR16,s1,initdef,dr0.0,ep2.0

# python -m src.merge_and_eval_drop \
#     --config_path $SAMA_CONFIG --model.adapter_path Llama2_exps/DROP/t=30d22h54m40,mlr1.0e-03,b4,nb16,16,cL16,rR16,s1,initdef,dr0.0,ep2.0

# PARENT_DIR="Llama2_exps/DROP"
PARENT_DIR="Llama2_exps/DROP"
for model_dir in "$PARENT_DIR"/*; do
    # Ensure it is a directory
    if [ -d "$model_dir" ]; then
        
        ft2_dir="$model_dir/ft2"
        results_dir="$model_dir/drop_vllm_results.json"

        # CONDITION:
        # 1. 'ft2' directory MUST exist (-d "$ft2_dir")
        # 2. 'results' directory must NOT exist (! -d "$results_dir")
        if [ -d "$ft2_dir" ] && [ ! -f "$results_dir" ]; then
            
            echo "----------------------------------------------------------------"
            echo "Processing: $model_dir"
            echo "Found 'ft2' folder. Starting evaluation..."
            
            # Execute python command
            python -m src.merge_and_eval_drop \
                --config_path $SAMA_CONFIG \
                --model.adapter_path "$model_dir"
            # exit 1

        # else
        #     # Logging skip reasons for clarity
        #     if [ ! -d "$ft2_dir" ]; then
        #         echo "[SKIP] No 'ft2' folder found in: $model_dir"
        #     elif [ -d "$results_dir" ]; then
        #         echo "[SKIP] Results already exist in: $model_dir"
        #     fi
        fi
    fi
done