ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more


Returns callable associated with given signature or None if not callable.

The available callables are defined by the model.signatures attribute which are defined at the time the model is saved. For keras based models, the model itself can also be used as can a callable attribute on the model named after the signature_name.

model A model that is callable or contains a signatures attribute. If neither of these conditions are met, then None will be returned.
signature_name Optional name of signature to use. If not provided then either the default serving signature will be used (if model is not callable) or the model itself will be used (if the model is callable). If provided then model.signatures will be used regardless of whether the model is callable or not.
required True if signature_name is required to exist if provided.

Callable associated with given signature (or the model itself) or None if no callable could be found.

ValueError If signature_name not found in model.signatures.