Describe Deployed Model Inputs and Outputs
Learn how to describe model inputs and outputs
Learn how to describe model inputs and outputs
Last updated 7th February, 2020.
This tutorial will help you identify the expected inputs and outputs of a deployed model on OVHcloud ML Serving.
model-evaluation
role for the deployed model. Steps for generating such token are described hereEach serialized model takes a list of named tensors as inputs and also returns a list of named tensors as outputs.
A named tensors is a N-Dimensional array with :
my-tensor-name
integer
or double
or string
(5)
for a vector of length 5, (3, 2)
for a matrix which first dimension is of size 3 and second dimension is of size 2. Etc.You can get access to the model inputs and outputs by calling the http GET
method on /describe
path of the model.
curl \
-H 'Authorization: Bearer <evaluation-token>' \
-X GET \
http://<your-model-url>/describe
In this example don't forget to replace the <evaluation-token>
with your model-evaluation token and <your-model-url>
with the url that was generated by ML Serving on your model deployment.
You will get a JSON object describing the list of inputs tensors that are needed to query your model as well as the list of outputs tensors that will be returning.
{
"inputs": [
{
"name": "sepal_length",
"type": "float",
"shape": [-1]
},
{
"name": "sepal_width",
"type": "float",
"shape": [-1]
},
{
"name": "petal_length",
"type": "float",
"shape": [-1]
},
{
"name": "petal_width",
"type": "float",
"shape": [-1]
}
],
"outputs": [
{
"name": "output_label",
"type": "long",
"shape": [-1]
},
{
"name": "output_probability",
"type": "float",
"shape": [-1, 2]
}
]
}
In this example, the deployed model is waiting for 4 tensors as inputs :
sepal_length
of shape (-1)
(i.e. a vector of any size)sepal_width
of shape (-1)
(i.e. a vector of any size)petal_length
of shape (-1)
(i.e. a vector of any size)petal_width
of shape (-1)
(i.e. a vector of any size)It will answer a response with 2 tensors as outputs :
output_label
of shape (-1)
(i.e. a vector of any size)output_probability
of shape (-1, 2)
(i.e. a matrix which first dimension is of any size and which second dimension is of size 2)Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community