Skip to content
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

Add sample requests and responses #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down