diff --git a/README.md b/README.md index ef1f326..0a6d0b2 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,36 @@ pipenv install ```angular2html pipenv run python index.py ``` +#### Sample REST calls + +##### Predict +###### Request +``` +curl -d '{"signature_name" :"predict-iris", "instances": [[1.0,2.0,5.0,0.3],[0.1,0.2,0.3,0.4]]}' -X POST http://localhost:8501/v1/models/myiris:predict +``` + +###### Response +``` +{ + "predictions": [[0.257784516, 0.526633084, 0.215582326], [0.394048154, 0.392151684, 0.213800162] + ] +} +``` + +##### Classify +###### Request +``` +curl -d '{"signature_name" :"serving_default", "examples": [{"x":[1.0,2.0,5.0,0.3]}] }' -X POST http://localhost:8501/v1/models/myiris:classify +``` + +###### Response +``` +{ + "results": [[["Iris-versicolor", 0.526633084], ["Iris-setosa", 0.257784516], ["Iris-virginica", 0.215582326]] + ] +} +``` + ### No Pipenv #### Don't want to use Pipenv because I am not awesome If you do not want to use **pipenv** then you must install these dependencies