Open IlnarSelimcan opened 1 year ago
Packages were installed this way:
## git clone https://github.com/Hugging-Face-Supporter/tftokenizers.git
## cd tftokenizers
## conda create -n py38 python=3.8
## conda activate py38
## curl -sSL https://install.python-poetry.org/ | python3 -
## poetry env use `which python3.8`
## poetry shell
## poetry install
This looks relevant: https://www.tensorflow.org/api_docs/python/tf/saved_model/save#example_3 ?
The following change made the error go away:
selimcan@patroclus:/tmp/tft/tftokenizers$ git diff
diff --git a/tftokenizers/model.py b/tftokenizers/model.py
index 1d91bca..ef77ea0 100644
--- a/tftokenizers/model.py
+++ b/tftokenizers/model.py
@@ -39,6 +39,7 @@ class TFModel(keras.layers.Layer):
self.tokenizer = tokenizer
self.model = model
+ @tf.function(input_signature=(tf.TensorSpec(shape=[None], dtype=tf.string),))
def call(
self,
inputs,
Hi,
first of all, thanks for sharing this code!
When I copy-paste the example from the Examples section of the Readme, the line
output = reloaded_model([s1, s2, s3])
causes the following error:Have you guys ever encountered that before?