mirror of
https://github.com/huggingface/transformers.git
synced 2025-10-20 17:13:56 +08:00
Remove the last few TF serving sigs (#23738)
Remove some more serving methods that (I think?) turned up while this PR was open
This commit is contained in:
@ -1938,34 +1938,6 @@ class TF{{cookiecutter.camelcase_modelname}}PreTrainedModel(TFPreTrainedModel):
|
||||
config_class = {{cookiecutter.camelcase_modelname}}Config
|
||||
base_model_prefix = "model"
|
||||
|
||||
@property
|
||||
def dummy_inputs(self):
|
||||
pad_token = 1
|
||||
input_ids = tf.cast(tf.convert_to_tensor(DUMMY_INPUTS), tf.int32)
|
||||
decoder_input_ids = tf.cast(tf.convert_to_tensor(DUMMY_INPUTS), tf.int32)
|
||||
dummy_inputs = {
|
||||
"decoder_input_ids": decoder_input_ids,
|
||||
"attention_mask": tf.math.not_equal(input_ids, pad_token),
|
||||
"input_ids": input_ids,
|
||||
}
|
||||
return dummy_inputs
|
||||
|
||||
@tf.function(
|
||||
input_signature=[
|
||||
{
|
||||
"input_ids": tf.TensorSpec((None, None), tf.int32, name="input_ids"),
|
||||
"attention_mask": tf.TensorSpec((None, None), tf.int32, name="attention_mask"),
|
||||
"decoder_input_ids": tf.TensorSpec((None, None), tf.int32, name="decoder_input_ids"),
|
||||
"decoder_attention_mask": tf.TensorSpec((None, None), tf.int32, name="decoder_attention_mask"),
|
||||
}
|
||||
]
|
||||
)
|
||||
# Copied from transformers.models.bart.modeling_tf_bart.TFBartPretrainedModel.serving
|
||||
def serving(self, inputs):
|
||||
output = self.call(inputs)
|
||||
|
||||
return self.serving_output(output)
|
||||
|
||||
|
||||
{{cookiecutter.uppercase_modelname}}_START_DOCSTRING = r"""
|
||||
This model inherits from [`TFPreTrainedModel`]. Check the superclass documentation for the
|
||||
|
Reference in New Issue
Block a user