-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all_tasks.sh
48 lines (41 loc) · 1.47 KB
/
run_all_tasks.sh
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
#!/bin/bash
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
BASEDIR=$(dirname "$SCRIPT")
# Navigate to the base directory to ensure all paths are relative to this script
cd "$BASEDIR" || { echo "Failed to navigate to the script's base directory"; exit 1; }
# Array of task names
TASKS=("niah" "variable_tracking" "qa")
# Loop through each task and execute the scripts
for TASK in "${TASKS[@]}"; do
echo "Starting $TASK Task..."
# Change to the task directory in data
if cd "data/$TASK"; then
# Run the task specific script
echo "Running $TASK Task..."
if ! python "${TASK}.py"; then
echo "Failed to run $TASK script"
fi
else
echo "Failed to change directory to data/$TASK"
fi
# Reset to base directory to ensure the correct path for eval
cd "$BASEDIR"
echo "base directory is $BASEDIR"
# Change directory to eval to run metrics
if cd "eval"; then
# Run the metrics generation script for the current task
echo "Generating Metrics for $TASK..."
if ! python generate.py task=$TASK; then
echo "Failed to generate metrics for $TASK"
fi
else
echo "Failed to change directory to eval"
fi
# Reset to base directory for the next iteration
cd "$BASEDIR"
echo "Current directory: $(pwd)"
echo "$TASK Task completed."
echo "-----------------------------"
done
echo "All tasks have been completed."