mleap
mleap copied to clipboard
how to use mleap model to do prediction?
i just run the image and put a model to localhost:65327,the question is how can i use this model to do prediction?
docker run -p 65327:65327 -v /tmp/models:/models combustml/mleap-serving:0.9.0-SNAPSHOT
curl -XPUT -H "content-type: application/json" \
-d '{"path":"/models/yourmodel.zip"}' \
http://localhost:65327/model
See if you can follow https://github.com/combust/mleap/tree/master/mleap-spring-boot and use the most recently released version 0.15.0, the easiest would be to do this, as mentioned in that README.md file
body='{YOUR_LEAP_FRAME_JSON}'
curl --header "Content-Type: application/json" \
--header "timeout: 1000" \
--request POST \
--data "$body" http://localhost:8080/models/{YOUR_MODEL_NAME}/transform
Please let me know if you have any questions!
See if you can follow https://github.com/combust/mleap/tree/master/mleap-spring-boot and use the most recently released version 0.15.0, the easiest would be to do this, as mentioned in that README.md file
body='{YOUR_LEAP_FRAME_JSON}' curl --header "Content-Type: application/json" \ --header "timeout: 1000" \ --request POST \ --data "$body" http://localhost:8080/models/{YOUR_MODEL_NAME}/transform``` Please let me know if you have any questions!
i start a image like this:
docker run -p 65327:65327 -v /tmp:/models combustml/mleap-serving:0.9.0-SNAPSHOT
files under /tmp are:
image
here is my question: i can put a model like this:
curl -XPUT -H "content-type: application/json"
-d '{"path":"/models/lr-pipeline.zip"}' http://localhost:65327/model
it returns :
{}%
but when i try to put a model like:
curl --header "Content-Type: application/json"
--request POST
--data '{"modelName":"lr","path":"/models/lr-pipeline.zip","config":{"memoryTimeout":900000,"diskTimeout":900000},"force":false}' http://localhost:65327/models
it returns :
The requested resource could not be found.%
if i put a model like {"path":"/models/lr-pipeline.zip","modelName":"lr"},still cannot get a model from http://localhost:65327/models/lr