Merge pull request #2869 from lissyx/scorer-fail-early

Add some early checks, for Scorer at first
This commit is contained in:
lissyx 2020-04-01 14:51:05 +02:00 committed by GitHub
commit 7b8b678310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -896,8 +896,17 @@ def do_single_file_inference(input_file_path):
print(decoded[0][1])
def early_checks():
# Check for proper scorer early
if FLAGS.scorer_path:
scorer = Scorer(FLAGS.lm_alpha, FLAGS.lm_beta,
FLAGS.scorer_path, Config.alphabet)
del scorer
def main(_):
initialize_globals()
early_checks()
if FLAGS.train_files:
tfv1.reset_default_graph()