mleap icon indicating copy to clipboard operation
mleap copied to clipboard

how to use mleap model to do prediction?

Open topxxuki opened this issue 5 years ago • 2 comments

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

topxxuki avatar Nov 15 '19 08:11 topxxuki

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!

ancasarb avatar Nov 26 '19 22:11 ancasarb

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 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

topxxuki avatar Dec 12 '19 03:12 topxxuki