-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
test_integration_espnetez.sh
executable file
·164 lines (138 loc) · 5.08 KB
/
test_integration_espnetez.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/env bash
# set -euo pipefail
source tools/activate_python.sh
PYTHONPATH="${PYTHONPATH:-}:$(pwd)/tools/s3prl"
export PYTHONPATH
python="python -m coverage run --append"
cwd=$(pwd)
gen_dummy_coverage(){
# To avoid a problem when parallel running for `coverage run`.
# Please put this command after cd ./egs2/foo/bar
touch empty.py; ${python} empty.py
}
#### Make sure chainer-independent ####
python3 -m pip uninstall -y chainer
# Download mini_an4 as test data and prepare flac data
cd ./egs2/mini_an4/asr1 || exit
./run.sh --stage 1 --stop-stage 1
./run.sh --stage 2 --stop-stage 4 --feats-type "raw"
# Now we have flac files under dump/org/train_*/data/format.*/
# and wav.scp files under dump/train_*/
rm -rf exp data/spm
# [ESPnet Easy] test asr recipe with coverage
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez.py \
--task asr \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path conf/train_asr_transformer_debug.yaml \
--train_sentencepiece_model \
--run_collect_stats \
--run_train
# finetuning
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez_ft.py \
--task asr \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path conf/train_asr_transformer_debug.yaml \
--run_finetune
# Remove generated files in order to reduce the disk usage
rm -rf exp data/spm
if python3 -c "from warprnnt_pytorch import RNNTLoss" &> /dev/null; then
# [ESPnet Easy] test asr transducer recipe with coverage
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez.py \
--task asr \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path conf/train_asr_transducer_debug.yaml \
--train_sentencepiece_model \
--run_collect_stats \
--run_train
# finetuning
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez_ft.py \
--task asr \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path conf/train_asr_transducer_debug.yaml \
--run_finetune
fi
# Remove generated files in order to reduce the disk usage
rm -rf exp data/spm
# [ESPnet Easy] test lm recipe with coverage
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez.py \
--task lm \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path ../lm1/conf/train_transformer.yaml \
--train_sentencepiece_model \
--run_collect_stats \
--run_train
# finetune
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez_ft.py \
--task lm \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path ../lm1/conf/train_transformer.yaml \
--run_finetune
# Remove generated files in order to reduce the disk usage
rm -rf exp data/spm
# [ESPnet Easy] test slu recipe with coverage
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez.py \
--task slu \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path ../s2t1/conf/train_slu_transformer.yaml \
--train_sentencepiece_model \
--run_collect_stats \
--run_train
# finetune
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez_ft.py \
--task slu \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path ../s2t1/conf/train_slu_transformer.yaml \
--run_finetune
# Remove generated files in order to reduce the disk usage
rm -rf exp data/spm
# [ESPnet Easy] test tts recipe with coverage
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez.py \
--task tts \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path ../tts1/conf/train_tacotron2_debug.yaml \
--train_sentencepiece_model \
--run_collect_stats \
--run_train
# finetune
python -m coverage run --append ../../../test/espnetez/test_integration_espnetez_ft.py \
--task tts \
--data_path data \
--train_dump_path dump/raw/train_nodev \
--valid_dump_path dump/raw/train_dev \
--exp_path ./exp \
--config_path ../tts1/conf/train_tacotron2_debug.yaml \
--run_finetune
# Remove generated files in order to reduce the disk usage
rm -rf exp data/spm
cd "${cwd}" || exit
echo "=== report ==="
python -m coverage combine egs2/*/*/.coverage
python -m coverage report
python -m coverage xml