File size: 851 Bytes
3916521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#EXPERIMENT_TYPES=("R-FA" "FA-R" "FA")
EXPERIMENT_TYPES=("FA")

for EXPERIMENT_TYPE in ${EXPERIMENT_TYPES[@]}; do
  echo "Running autotrain for experiment type: ${EXPERIMENT_TYPE}"

  # Export the variable to make it available to envsubst
  export EXPERIMENT_TYPE=${EXPERIMENT_TYPE}

  # Substitute the variable into the template
  envsubst < ./autotrain/autotrain_template.yml > ./autotrain/autotrain.yml

  # Echo the contents of the substituted YAML file
  echo "Generated autotrain.yml:"
  cat ./autotrain/autotrain.yml
  echo "-----------------------------------"

  # Run the autotrain command
  autotrain --config ./autotrain/autotrain.yml

  # Check if the command was successful
  if [[ $? -ne 0 ]]; then
    echo "Error running autotrain for ${EXPERIMENT_TYPE}, exiting."
    exit 1
  fi
done

echo "All experiments completed successfully!"