Tensorflow Keras SavedModel custom signature

How can we add a custom signature without overriding the SavedModel’s serving_default signature?

For example, I have an image classification model and I would like to add a signature definition that receives an image byte string instead of numpy array or a tensor. How can i add this custom signature and keep the serving_default signature untouched or as it is now?

signatures = {
‘serving_default’: ???,
‘serving_bytes’: _get_image_bytes_serving_signature(model)
}
model.save(model_dir, signatures=signatures)

Hi @Peter, For saving model with multiple signatures, you have to define the module class and get the signatures using get_concrete_function and pass those signatures while saving the model. Please refer to this gist for working code example. Thank You.