When using the "sharing model" feature, the tool produces code to copy and execute in a new Google Colab notebook. Here is the snippet to predict a step
examples = {
"value" : ["<OOD>, second, fourth, third, fifth, first", "<OOD>, third, fifth, first, fourth, second, sixth."],
}
model.predict_step(examples)
This code does not work out of the box and generates the following error:
ValueError: Exception encountered when calling layer 'inference_core_model_4' (type InferenceCoreModel).
Could not find matching concrete function to call loaded from the SavedModel. Got:
Positional arguments (2 total):
* {'value': ['<OOD>, second, fourth, third, fifth, first',
'<OOD>, third, fifth, first, fourth, second, sixth.']}
* False
Keyword arguments: {}
Expected these arguments to match one of the following 2 option(s):
Option 1:
Positional arguments (2 total):
* {'value': RaggedTensorSpec(TensorShape([None, None]), tf.string, 1, tf.int64)}
* False
Keyword arguments: {}
Option 2:
Positional arguments (2 total):
* {'value': RaggedTensorSpec(TensorShape([None, None]), tf.string, 1, tf.int64)}
* True
Keyword arguments: {}
Call arguments received by layer 'inference_core_model_4' (type InferenceCoreModel):
• args=({'value': ["'<OOD>, second, fourth, third, fifth, first'", "'<OOD>, third, fifth, first, fourth, second, sixth.'"]},)
• kwargs={'training': 'False'}
Can the example code produced by the SimpleML tool be modified to something that works without modification?
How can I modify the examples variable so the call succeeds?