Commit 53f76b23 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Make 'embedding_layer' an optional config field for backwards compatibility.

PiperOrigin-RevId: 339090333
parent cd5e1204
...@@ -250,7 +250,7 @@ class BertEncoder(tf.keras.Model): ...@@ -250,7 +250,7 @@ class BertEncoder(tf.keras.Model):
@classmethod @classmethod
def from_config(cls, config, custom_objects=None): def from_config(cls, config, custom_objects=None):
if config['embedding_layer'] is not None: if 'embedding_layer' in config and config['embedding_layer'] is not None:
warn_string = ( warn_string = (
'You are reloading a model that was saved with a ' 'You are reloading a model that was saved with a '
'potentially-shared embedding layer object. If you contine to ' 'potentially-shared embedding layer object. If you contine to '
......
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