Commit 9c50e961 authored by Chen Chen's avatar Chen Chen Committed by A. Unique TensorFlower
Browse files

Completely remove "use_keras_bert_for_squad" FLAG.

PiperOrigin-RevId: 282384787
parent 5b2575c2
...@@ -340,7 +340,6 @@ class BertSquadAccuracy(BertSquadBenchmarkBase): ...@@ -340,7 +340,6 @@ class BertSquadAccuracy(BertSquadBenchmarkBase):
FLAGS.init_checkpoint = PRETRAINED_CHECKPOINT_PATH FLAGS.init_checkpoint = PRETRAINED_CHECKPOINT_PATH
FLAGS.num_train_epochs = 2 FLAGS.num_train_epochs = 2
FLAGS.steps_per_loop = 1 FLAGS.steps_per_loop = 1
FLAGS.use_keras_bert_for_squad = True
def _run_and_report_benchmark(self, def _run_and_report_benchmark(self,
use_ds=True, use_ds=True,
......
...@@ -80,8 +80,6 @@ flags.DEFINE_integer( ...@@ -80,8 +80,6 @@ flags.DEFINE_integer(
'max_answer_length', 30, 'max_answer_length', 30,
'The maximum length of an answer that can be generated. This is needed ' '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.') '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() common_flags.define_common_bert_flags()
...@@ -374,10 +372,6 @@ def main(_): ...@@ -374,10 +372,6 @@ def main(_):
# Users should always run this script under TF 2.x # Users should always run this script under TF 2.x
assert tf.version.VERSION.startswith('2.') 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: with tf.io.gfile.GFile(FLAGS.input_meta_data_path, 'rb') as reader:
input_meta_data = json.loads(reader.read().decode('utf-8')) input_meta_data = json.loads(reader.read().decode('utf-8'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment