forked from mozilla/DeepSpeech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tc-node-tests.sh
38 lines (27 loc) · 1.03 KB
/
tc-node-tests.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
#!/bin/bash
set -xe
source $(dirname "$0")/tc-tests-utils.sh
nodever=$1
aot_model=$2
if [ -z "${nodever}" ]; then
echo "No node version given, aborting."
exit 1
fi;
download_data
node --version
npm --version
if [ "${aot_model}" = "--aot" ]; then
npm install ${DEEPSPEECH_AOT_ARTIFACTS_ROOT}/deepspeech-0.1.0.tgz
else
npm install ${DEEPSPEECH_NODEJS}/deepspeech-0.1.0.tgz
fi
export PATH=$HOME/node_modules/.bin/:$PATH
phrase_pbmodel_nolm=$(deepspeech /tmp/${model_name} /tmp/LDC93S1.wav /tmp/alphabet.txt)
assert_correct_ldc93s1 "${phrase_pbmodel_nolm}"
phrase_pbmodel_withlm=$(deepspeech /tmp/${model_name} /tmp/LDC93S1.wav /tmp/alphabet.txt /tmp/lm.binary /tmp/trie)
assert_correct_ldc93s1 "${phrase_pbmodel_withlm}"
if [ "${aot_model}" = "--aot" ]; then
phrase_somodel_nolm=$(deepspeech "" /tmp/LDC93S1.wav /tmp/alphabet.txt)
phrase_somodel_withlm=$(deepspeech "" /tmp/LDC93S1.wav /tmp/alphabet.txt /tmp/lm.binary /tmp/trie)
assert_correct_ldc93s1_somodel "${phrase_somodel_nolm}" "${phrase_somodel_withlm}"
fi