-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mleap Spring Boot Swagger Documentation Seems Incorrect #861
Comments
Hello @habib27, Are you following the tutorial here ? To transform a frame, you need to format it as mleap expects it. Here is an example for airbnb leap frame: {
"schema": {
"fields": [{
"name": "state",
"type": "string"
}, {
"name": "bathrooms",
"type": "double"
}, {
"name": "square_feet",
"type": "double"
}, {
"name": "bedrooms",
"type": "double"
}, {
"name": "security_deposit",
"type": "double"
}, {
"name": "cleaning_fee",
"type": "double"
}, {
"name": "extra_people",
"type": "double"
}, {
"name": "number_of_reviews",
"type": "double"
}, {
"name": "review_scores_rating",
"type": "double"
}, {
"name": "room_type",
"type": "string"
}, {
"name": "host_is_superhost",
"type": "string"
}, {
"name": "cancellation_policy",
"type": "string"
}, {
"name": "instant_bookable",
"type": "string"
}]
},
"rows": [["NY", 2.0, 1250.0, 3.0, 50.0, 30.0, 2.0, 56.0, 90.0, "Entire home/apt", "1.0", "strict", "1.0"]]
} Reference for leap frame: https://github.com/combust/mleap/blob/master/mleap-executor-testkit/src/main/resources/leap_frame/frame.airbnb.json Then, to query the model simply do: body=$(cat frame.airbnb.json)
curl --header "Content-Type: application/json" \
--header "timeout: 1000" \
--request POST \
--data "$body" http://localhost:8080/models/AirBnBLR/transform |
Hey @ltrottier-yelp , Thank you for the reply. Yes I followed that tutorial. The link to the airbnb frame does not work for me, says all access is disabled. But that payload I was able to find somewhere and use and it does work. However, the issue is you see that type field that is being used there in the example, it's not in the swagger and I don't know what are the possible values for it. For example if I have a model where the value is double but the base is "Tensor", what type do I pass in to make it work? I get this error : "status": "STATUS_ERROR", Is there anywhere I can find what the valid values are for this type field? |
I'm taking a look at the swagger file, because it looks outdated. I'll try to update it soon. The frame that you pass to the server is the same as a leap frame that you create in scala. It is simply its json representation. So you have two choices:
|
Hey @ltrottier-yelp , Thank you very much for your help and prompt response. I appreciate it. |
Hi,
I have been exploring the mleap-spring-boot project. The swagger documentation seems to be off for the transform endpoint.
In the swagger for the endpoint --> /models/{modelName}/transform
It mentions that the body is supposed to be the following:
{
"schema": {
"fields": [
{
"name": "string",
"dataType": {
"base": "BOOLEAN",
"shape": {
"base": "SCALAR",
"isNullable": true,
"tensorShape": [
{
"size": 0,
"name": "string"
}
]
}
}
}
]
},
"rows": [
[
{}
]
]
}
However, when you use that body there is an error --> "error": "NoSuchElementException: key not found: type",
Seems like a type field is required. Am i missing something? Also what are valid values for type.
Thank you for help, much appreciated.
The text was updated successfully, but these errors were encountered: