From ec37b3324a64d473590607e906dfb144b4792c93 Mon Sep 17 00:00:00 2001 From: Josh Meyer Date: Wed, 21 Jul 2021 15:13:39 -0400 Subject: [PATCH] Add example python script with initialize_globals_from_args() --- bin/run-ldc93s1.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 bin/run-ldc93s1.py diff --git a/bin/run-ldc93s1.py b/bin/run-ldc93s1.py new file mode 100755 index 00000000..ac81ff66 --- /dev/null +++ b/bin/run-ldc93s1.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +import os +from import_ldc93s1 import _download_and_preprocess_data as download_ldc +from coqui_stt_training.util.config import Config, initialize_globals_from_args +from coqui_stt_training.train import train, test, early_training_checks +from coqui_stt_ctcdecoder import Alphabet +import tensorflow.compat.v1 as tfv1 + +# only one GPU for only one training sample +os.environ['CUDA_VISIBLE_DEVICES']='0' + +download_ldc("data/ldc93s1") + +initialize_globals_from_args( + alphabet_config_path="data/alphabet.txt", + train_files=["data/ldc93s1/ldc93s1.csv"], + dev_files=["data/ldc93s1/ldc93s1.csv"], + test_files=["data/ldc93s1/ldc93s1.csv"], + n_hidden=100, + epochs=200 +) + +early_training_checks() + +train() +tfv1.reset_default_graph() +test()