-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·36 lines (30 loc) · 1.01 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·36 lines (30 loc) · 1.01 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
#!/bin/bash
# Variables
ENVIRONMENT="default" # Specify the pixi environment to use
# Check if at least two arguments are provided
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Error: you need to specify both a mode (train, val, test) and a config file."
echo "Usage: ./run_training.sh <mode> <config_file>"
exit 1
fi
MODE=$1 # Mode (train, val, test)
CONFIG_PATH=$2 # Path to the configuration file
# Execute the appropriate command based on the mode using pixi run
echo "Running main.py in $MODE mode with config file $CONFIG_PATH using pixi run..."
case "$MODE" in
train)
pixi run --environment "$ENVIRONMENT" python3 main.py --config "$CONFIG_PATH"
;;
val)
pixi run --environment "$ENVIRONMENT" python3 main.py val --config "$CONFIG_PATH"
;;
test)
pixi run --environment "$ENVIRONMENT" python3 main.py test --config "$CONFIG_PATH"
;;
*)
echo "Error: unknown mode $MODE. Use train, val, or test."
exit 1
;;
esac
# Completion message
echo "Script completed successfully."