Commit eabff6f0 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

Makes do_lower_case not trainable.

PiperOrigin-RevId: 275192365
parent 9317f3b4
...@@ -70,7 +70,8 @@ def export_bert_tfhub(bert_config: bert_modeling.BertConfig, ...@@ -70,7 +70,8 @@ def export_bert_tfhub(bert_config: bert_modeling.BertConfig,
checkpoint = tf.train.Checkpoint(model=core_model) checkpoint = tf.train.Checkpoint(model=core_model)
checkpoint.restore(model_checkpoint_path).assert_consumed() checkpoint.restore(model_checkpoint_path).assert_consumed()
core_model.vocab_file = tf.saved_model.Asset(vocab_file) core_model.vocab_file = tf.saved_model.Asset(vocab_file)
core_model.do_lower_case = tf.Variable("uncased" in vocab_file) core_model.do_lower_case = tf.Variable(
"uncased" in vocab_file, trainable=False)
core_model.save(hub_destination, include_optimizer=False, save_format="tf") core_model.save(hub_destination, include_optimizer=False, save_format="tf")
......
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