how can we only export a model with only tokens in signatures?
The following method would have the error when using saved_model_cli. tensorflow.python.framework.errors_impl.InvalidArgumentError: 'func' argument to TF_GraphCopyFunction cannot be null
What are you looking to do? If you just want to verify the input/output nodes, you should replace --all by --tag_set serve --signature_def serving_default
This works. How can I create a serialized example tf record for the model to predict? Since inputs expect tokens and length.
This one won’t work with the following error Expected argument names ['length', 'tokens'] but got values for ['length']. Missing: ['tokens'].
bytes_query = [term.encode('utf-8') for term in query]
feature = {
'tokens': _bytes_feature(bytes_query),
'length': _int64_feature(len(query))
}
example = tf.train.Example(features=tf.train.Features(feature=feature))
example_proto = example.SerializeToString()
I saw the source code for RecordInputter was like.
feature_lists = tf.train.FeatureLists(feature_list={"values": feature_list})
example = tf.train.SequenceExample(feature_lists=feature_lists)
example_proto = example.SerializeToString()
How can I create a serialized example for prediction?
Yes. I also saw this file. But we would need to prepare a tfrecord file that another client can use it for predict. Can we achieve that with a serialized tfrecord?
Got it. Thanks a lot. Another question is whether we can parse only tokens as signatures input.
def make_features(self, element=None, features=None, training=None):
"""Tokenizes raw text."""
if features is None:
features = {}
if "tokens" in features:
return features
what can we add here to generate length based on tokens? Assume the batch size is always one.
Thanks a lot. When I check the averaged-ende-ckpt500k-v2, it doesn’t have any .model file. But the saved model has the wmtende.model under assets.extra, which I guess it is generated from export_assets, I am curious where we can get this one.
The following code snippet won’t generate this assets.extra. In addition, where can we find the source code for bpe or sp tokenize function? Are they other open source repo? Thanks
Since it expects only one input feature. That’s why I asked the length feature above. Can I ask why we design it to have a length input? Isn’t it just the len(tokens)?