From 9252cef138a35cd6279322ff00246dbc44d5ac96 Mon Sep 17 00:00:00 2001 From: Josh Meyer Date: Thu, 10 Jun 2021 10:49:54 -0400 Subject: [PATCH] Add changes from pre-commit hook --- bin/graphdef_binary_to_text.py | 3 +-- bin/import_librivox.py | 1 - bin/import_ted.py | 1 - bin/import_voxforge.py | 1 - lm_optimizer.py | 3 +-- training/coqui_stt_training/evaluate.py | 2 +- training/coqui_stt_training/train.py | 2 +- training/coqui_stt_training/util/checkpoints.py | 3 ++- training/coqui_stt_training/util/config.py | 3 +-- training/coqui_stt_training/util/feeding.py | 2 +- transcribe.py | 3 ++- 11 files changed, 10 insertions(+), 14 deletions(-) diff --git a/bin/graphdef_binary_to_text.py b/bin/graphdef_binary_to_text.py index 83f32fdb..032d3836 100755 --- a/bin/graphdef_binary_to_text.py +++ b/bin/graphdef_binary_to_text.py @@ -3,9 +3,8 @@ import sys -from google.protobuf import text_format - import tensorflow.compat.v1 as tfv1 +from google.protobuf import text_format def main(): diff --git a/bin/import_librivox.py b/bin/import_librivox.py index 3469f7f9..f2d77091 100755 --- a/bin/import_librivox.py +++ b/bin/import_librivox.py @@ -11,7 +11,6 @@ import pandas import progressbar from coqui_stt_training.util.downloader import maybe_download from sox import Transformer - from tensorflow.python.platform import gfile SAMPLE_RATE = 16000 diff --git a/bin/import_ted.py b/bin/import_ted.py index cb63a4f9..cd8643e2 100755 --- a/bin/import_ted.py +++ b/bin/import_ted.py @@ -10,7 +10,6 @@ import pandas from coqui_stt_training.util.downloader import maybe_download from coqui_stt_training.util.stm import parse_stm_file from sox import Transformer - from tensorflow.python.platform import gfile diff --git a/bin/import_voxforge.py b/bin/import_voxforge.py index c0e293f8..e033ddbf 100755 --- a/bin/import_voxforge.py +++ b/bin/import_voxforge.py @@ -14,7 +14,6 @@ from os import makedirs, path import pandas from bs4 import BeautifulSoup from coqui_stt_training.util.downloader import maybe_download - from tensorflow.python.platform import gfile """The number of jobs to run in parallel""" diff --git a/lm_optimizer.py b/lm_optimizer.py index 669e4ba9..86100ec4 100644 --- a/lm_optimizer.py +++ b/lm_optimizer.py @@ -6,6 +6,7 @@ import sys import absl.app import optuna +import tensorflow.compat.v1 as tfv1 from coqui_stt_ctcdecoder import Scorer from coqui_stt_training.evaluate import evaluate from coqui_stt_training.train import create_model @@ -14,8 +15,6 @@ from coqui_stt_training.util.evaluate_tools import wer_cer_batch from coqui_stt_training.util.flags import FLAGS, create_flags from coqui_stt_training.util.logging import log_error -import tensorflow.compat.v1 as tfv1 - def character_based(): is_character_based = False diff --git a/training/coqui_stt_training/evaluate.py b/training/coqui_stt_training/evaluate.py index a1311d7c..ecff4502 100755 --- a/training/coqui_stt_training/evaluate.py +++ b/training/coqui_stt_training/evaluate.py @@ -7,11 +7,11 @@ import sys from multiprocessing import cpu_count import progressbar +import tensorflow.compat.v1 as tfv1 from coqui_stt_ctcdecoder import Scorer, ctc_beam_search_decoder_batch from six.moves import zip import tensorflow as tf -import tensorflow.compat.v1 as tfv1 from .util.augmentations import NormalizeSampleRate from .util.checkpoints import load_graph_for_evaluation diff --git a/training/coqui_stt_training/train.py b/training/coqui_stt_training/train.py index 076b8569..2cf02397 100644 --- a/training/coqui_stt_training/train.py +++ b/training/coqui_stt_training/train.py @@ -17,9 +17,9 @@ import time import numpy as np import progressbar +import tensorflow.compat.v1 as tfv1 import tensorflow as tf -import tensorflow.compat.v1 as tfv1 tfv1.logging.set_verbosity( { diff --git a/training/coqui_stt_training/util/checkpoints.py b/training/coqui_stt_training/util/checkpoints.py index 32f48ffd..434d403c 100644 --- a/training/coqui_stt_training/util/checkpoints.py +++ b/training/coqui_stt_training/util/checkpoints.py @@ -1,8 +1,9 @@ import sys -import tensorflow as tf import tensorflow.compat.v1 as tfv1 +import tensorflow as tf + from .config import Config, log_error, log_info, log_warn diff --git a/training/coqui_stt_training/util/config.py b/training/coqui_stt_training/util/config.py index d2897497..e0c925b9 100755 --- a/training/coqui_stt_training/util/config.py +++ b/training/coqui_stt_training/util/config.py @@ -6,13 +6,12 @@ from dataclasses import asdict, dataclass, field from typing import List import progressbar +import tensorflow.compat.v1 as tfv1 from attrdict import AttrDict from coqpit import MISSING, Coqpit, check_argument from coqui_stt_ctcdecoder import Alphabet, UTF8Alphabet from xdg import BaseDirectory as xdg -import tensorflow.compat.v1 as tfv1 - from .augmentations import NormalizeSampleRate, parse_augmentations from .gpu import get_available_gpus from .helpers import parse_file_size diff --git a/training/coqui_stt_training/util/feeding.py b/training/coqui_stt_training/util/feeding.py index 8a070b5e..333c78ce 100644 --- a/training/coqui_stt_training/util/feeding.py +++ b/training/coqui_stt_training/util/feeding.py @@ -5,9 +5,9 @@ from collections import Counter from functools import partial import numpy as np +from tensorflow.python.ops import gen_audio_ops as contrib_audio import tensorflow as tf -from tensorflow.python.ops import gen_audio_ops as contrib_audio from .audio import DEFAULT_FORMAT, pcm_to_np, read_frames_from_file, vad_split from .augmentations import apply_graph_augmentations, apply_sample_augmentations diff --git a/transcribe.py b/transcribe.py index 6ca6d441..b0492c87 100755 --- a/transcribe.py +++ b/transcribe.py @@ -7,9 +7,10 @@ import os import sys os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" -import tensorflow as tf import tensorflow.compat.v1.logging as tflogging +import tensorflow as tf + tflogging.set_verbosity(tflogging.ERROR) import logging