-
Notifications
You must be signed in to change notification settings - Fork 12
/
run_micro_services.sh
40 lines (34 loc) · 1.25 KB
/
run_micro_services.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
#!/usr/bin/env bash
OUTPUT_DIR="transformer_output"
TASK_CONFIG="attention/services/create_copy_task/default_config.json"
METADATA="attention/services/attention_train/default_metadata.json"
TRAIN_CONFIG="attention/services/attention_train/default_config.json"
TRAIN_FOLDER="/train"
EVAL_FOLDER="/eval"
MODEL_FOLDER="/model"
EXP_NAME=""
CODE_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
while test $# -gt 0; do
case $1 in
-n | --name)
EXP_NAME=$2
shift;
shift;
;;
*)
break
;;
esac
done
if [ "$EXP_NAME" = '' ]; then
echo "Experiment will be run without saving current version of the code/config"
else
echo "Saving current configuration and files"
mkdir -p $OUTPUT_DIR
tar -zcf $OUTPUT_DIR\/$EXP_NAME.tar.gz $CODE_FOLDER\/.
fi
echo "Running Task Data Generation"
python3 attention/services/create_copy_task/create_copy_task.py --output_dir $OUTPUT_DIR --config $TASK_CONFIG
echo "Run Task Data Generation"
echo "Run Attention Traininig"
python3 attention/services/attention_train/attentiontrain.py --train_data_dir $OUTPUT_DIR$TRAIN_FOLDER --metadata $METADATA --valid_data_dir $OUTPUT_DIR$EVAL_FOLDER --output_dir $OUTPUT_DIR$MODEL_FOLDER -c $TRAIN_CONFIG