From 9c50e9612bf48b9a9cb85ec09d972b101c1b1178 Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Mon, 25 Nov 2019 10:25:36 -0800 Subject: [PATCH] Completely remove "use_keras_bert_for_squad" FLAG. PiperOrigin-RevId: 282384787 --- official/benchmark/bert_squad_benchmark.py | 1 - official/nlp/bert/run_squad.py | 6 ------ 2 files changed, 7 deletions(-) diff --git a/official/benchmark/bert_squad_benchmark.py b/official/benchmark/bert_squad_benchmark.py index 85e3f5e8c..3255a5aa7 100644 --- a/official/benchmark/bert_squad_benchmark.py +++ b/official/benchmark/bert_squad_benchmark.py @@ -340,7 +340,6 @@ class BertSquadAccuracy(BertSquadBenchmarkBase): FLAGS.init_checkpoint = PRETRAINED_CHECKPOINT_PATH FLAGS.num_train_epochs = 2 FLAGS.steps_per_loop = 1 - FLAGS.use_keras_bert_for_squad = True def _run_and_report_benchmark(self, use_ds=True, diff --git a/official/nlp/bert/run_squad.py b/official/nlp/bert/run_squad.py index db66a71a2..82ed92223 100644 --- a/official/nlp/bert/run_squad.py +++ b/official/nlp/bert/run_squad.py @@ -80,8 +80,6 @@ flags.DEFINE_integer( 'max_answer_length', 30, 'The maximum length of an answer that can be generated. This is needed ' 'because the start and end predictions are not conditioned on one another.') -flags.DEFINE_bool( - 'use_keras_bert_for_squad', True, 'Deprecated and will be removed soon.') common_flags.define_common_bert_flags() @@ -374,10 +372,6 @@ def main(_): # Users should always run this script under TF 2.x assert tf.version.VERSION.startswith('2.') - if not FLAGS.use_keras_bert_for_squad: - raise ValueError( - 'Old tf2 BERT is no longer supported. Please use keras BERT.') - with tf.io.gfile.GFile(FLAGS.input_meta_data_path, 'rb') as reader: input_meta_data = json.loads(reader.read().decode('utf-8')) -- GitLab