Commit 17155b49 authored by Chen Chen's avatar Chen Chen Committed by A. Unique TensorFlower
Browse files

Avoid loading hub model twice

PiperOrigin-RevId: 338249187
parent 7cffe103
......@@ -49,8 +49,8 @@ def get_encoder_from_hub(hub_model_path: str) -> tf.keras.Model:
# as input and returns a dict.
# TODO(chendouble): Remove the support of legacy hub model when the new ones
# are released.
hub_model = hub.load(hub_model_path)
hub_output_signature = hub_model.signatures['serving_default'].outputs
hub_output_signature = hub_layer.resolved_object.signatures[
'serving_default'].outputs
if len(hub_output_signature) == 2:
logging.info('Use the legacy hub module with list as input/output.')
pooled_output, sequence_output = hub_layer(
......
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