Skip to content

Commit

Permalink
Remove deprecated eager_serving fn (huggingface#28665)
Browse files Browse the repository at this point in the history
* Remove deprecated eager_serving fn

* Fix the input_signature docstring while I'm here
  • Loading branch information
Rocketknight1 authored Jan 23, 2024
1 parent 9a4521d commit ebc8f47
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/transformers/modeling_tf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,28 +1210,11 @@ def serving(self, inputs):

return self.serving_output(output)

def eager_serving(self, inputs):
"""
Method used for serving the model. This method is deprecated, and will be removed.
Args:
inputs (`Dict[str, tf.Tensor]`):
The input of the saved model as a dictionary of tensors.
"""
warnings.warn(
"The function `eager_serving` is deprecated and will be removed in version 4.32.0 of Transformers",
FutureWarning,
)
output = self.call(inputs)

return self.serving_output(output)

@property
def input_signature(self) -> Dict[str, tf.TensorSpec]:
"""
This property should return a dict mapping input names to tf.TensorSpec objects, representing the expected
shape and dtype for model inputs. It is used for both serving and for generating the dummy inputs used to build
the model.
shape and dtype for model inputs. It is used for both serving and for generating dummy inputs.
"""
model_inputs = list(inspect.signature(self.call).parameters)
sig = {}
Expand Down

0 comments on commit ebc8f47

Please sign in to comment.