-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun.sh
More file actions
40 lines (25 loc) · 847 Bytes
/
run.sh
File metadata and controls
40 lines (25 loc) · 847 Bytes
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
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -lt 3 ]; then
echo "Usage: $0 <DATASET> <START_FOLD_IDX> <END_FOLD_IDX>"
exit 1
fi
# Assign variables
DATASET=$1
START_FOLD=$2
END_FOLD=$3
# Activate Conda environment and set Python path
# Ensure conda is initialized for non-interactive shells
eval "$(conda shell.bash hook)"
conda activate RAG-Fuse
export PYTHONPATH=$PYTHONPATH:$(pwd)
# Run the dataset-specific script for each fold index in the given range
SCRIPT_PATH="run/${DATASET}.sh"
# Check if the script exists before running it
if [ ! -f "$SCRIPT_PATH" ]; then
echo "Error: Script for dataset '$DATASET' not found at '$SCRIPT_PATH'"
exit 1
fi
# run the script
echo "Running $SCRIPT_PATH from fold $START_FOLD to fold $END_FOLD..."
bash "$SCRIPT_PATH" "$START_FOLD" "$END_FOLD"