-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathrun_experiment.sh
More file actions
38 lines (31 loc) · 1.19 KB
/
run_experiment.sh
File metadata and controls
38 lines (31 loc) · 1.19 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
set -euo pipefail
echo "=== Starting Black-box Model Experiment ==="
echo "Setting GPU environment variables..."
export CUDA_LAUNCH_BLOCKING=1
export CUDA_CACHE_PATH=/tmp/cuda_cache
export CUDA_VISIBLE_DEVICES=0,1
export TOKENIZERS_PARALLELISM=false
echo "CUDA_VISIBLE_DEVICES set to: $CUDA_VISIBLE_DEVICES"
# === end of your original block ===
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# (Optional) quick sanity checks.
if [ ! -f "main.py" ]; then
echo "Error: main.py not found in $(pwd)"
exit 1
fi
if [ ! -f "config/config.yml" ]; then
echo "Error: config/config.yml not found"
exit 1
fi
echo "Configuration file found"
# Run your original command.
# Usage examples:
# - Full pipeline: python main.py --config config/config.yml --phase full --verbose
# - Jailbreak only: python main.py --config config/config.yml --phase jailbreak --verbose
# - Judge only: python main.py --config config/config.yml --phase judge --verbose
# - Resume: python main.py --config config/config.yml --phase resume --verbose
echo "Starting experiment with main.py..."
python main.py --config config/config.yml --phase full --verbose
echo
echo "=== Experiment finished ==="