Skip to content

Commit

Permalink
added test ci lm opt
Browse files Browse the repository at this point in the history
  • Loading branch information
wasertech committed Apr 26, 2022
1 parent 5783014 commit f7e5cc2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,9 @@ jobs:
# Test FLAC input
time ./bin/run-ci-ldc93s1-flac.sh --epochs 1
# Test LM opt
time ./bin/run-ci-lm-opt.sh
training-sdb-tests:
name: "Lin|SDB training tests"
runs-on: ubuntu-20.04
Expand Down
34 changes: 34 additions & 0 deletions bin/run-ci-lm-opt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

# This test optimizes the scorer for testing purposes

set -xe

if [ ! -f lm_optimizer.py ]; then
echo "Please make sure you run this from STT's top level directory."
exit 1
fi;

LM_ALPHA_MAX=1
LM_BETA_MAX=1
LM_NUM_TRIALS=1

scorer_filepath="./data/smoke_test/pruned_lm.scorer"
test_filepath="./data/smoke_test/ldc93s1_flac.csv"

checkpoint_dirpath="./data"
mkdir -p checkpoint_dirpath
# Force only one visible device because we have a single-sample dataset
# and when trying to run on multiple devices (like GPUs), this will break

export CUDA_VISIBLE_DEVICES=0

python -m coqui_stt_training.util.lm_optimize \
--scorer_path $scorer_filepath \
--checkpoint_dir "$checkpoint_dirpath" \
--test_files $test_filepath \
--n_trials $LM_NUM_TRIALS \
--lm_alpha_max ${LM_ALPHA_MAX} \
--lm_beta_max ${LM_BETA_MAX} \
--feature_cache /tmp/lm_feature_cache \
"$@"

0 comments on commit f7e5cc2

Please sign in to comment.