Update serving signatures and make sure we actually use them (#19034)

* Override save() to use the serving signature as the default

* Replace int32 with int64 in all our serving signatures

* Remember one very important line so as not to break every test at once

* Dtype fix for TFLED

* dtype fix for shift_tokens_right in general

* Dtype fixes in mBART and RAG

* Fix dtypes for test_unpack_inputs

* More dtype fixes

* Yet more mBART + RAG dtype fixes

* Yet more mBART + RAG dtype fixes

* Add a check that the model actually has a serving method
This commit is contained in:
Matt
2022-09-15 14:34:22 +01:00
committed by GitHub
parent 9b80a0bc18
commit 2322eb8e2f
35 changed files with 179 additions and 97 deletions

View File

@@ -1887,9 +1887,9 @@ class UtilsFunctionsTest(unittest.TestCase):
return pixel_values, output_attentions, output_hidden_states, return_dict
dummy_model = DummyModel()
input_ids = tf.constant([0, 1, 2, 3])
past = tf.constant([4, 5, 6, 7])
pixel_values = tf.constant([8, 9, 10, 11])
input_ids = tf.constant([0, 1, 2, 3], dtype=tf.int64)
past = tf.constant([4, 5, 6, 7], dtype=tf.int64)
pixel_values = tf.constant([8, 9, 10, 11], dtype=tf.int64)
# test case 1: Pass inputs as keyword arguments; Booleans are inherited from the config.
output = dummy_model.call(input_ids=input_ids, past=past)