-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_predict.sh
67 lines (53 loc) · 1.48 KB
/
run_predict.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# Activate Conda
eval "$(conda shell.bash hook)"
# Initialize variables
input_file=""
model_dir=""
output_dir=""
clean=""
flush=""
anonymize=""
# Parse named arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
-i|--input_file) input_file="$2"; shift ;;
-m|--model_dir) model_dir="$2"; shift ;;
-o|--output_dir) output_dir="$2"; shift ;;
--clean) clean="$2"; shift ;;
--flush) flush="$2"; shift ;;
--anonymize) anonymize="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
# Check required arguments
if [ -z "$input_file" ]; then
echo "Error: --input_file (-i) is required."
exit 1
fi
if [ -z "$model_dir" ]; then
echo "Error: --model_dir (-m) is required."
exit 1
fi
eval "$(conda shell.bash hook)"
conda activate zairasetup
command="python 01_setup/zairasetup/run_predict.py -i '$input_file' -m '$model_dir'"
# Add output_dir if provided
if [ -n "$output_dir" ]; then
command="$command -o '$output_dir'"
fi
# Run the command
eval "$command"
conda activate zairadescribe
python 02_describe/zairadescribe/run.py
conda activate zairatreat
python 03_treat/zairatreat/run.py
conda activate zairaestimate
python 04_estimate/zairaestimate/run.py
conda activate zairapool
python 05_pool/zairapool/run.py
conda activate zairareport
python 06_report/zairareport/run.py
conda activate zairafinish
python 07_finish/zairafinish/run.py --clean "$clean" --flush "$flush" --anonymize "$anonymize"