Skip to content

Commit

Permalink
documentation: Remove redundant curl options in example (#336)
Browse files Browse the repository at this point in the history
* documentation: fixed issues in installation and quick start in README.md

* documentation: Reverting conda related doc changes from PR#286

Fixes #297

* remove minus y (#311)

update pip install instructions

* fix-doc

* fix remaining "-X POST"s

Co-authored-by: eslesar-aws <eslesar@amazon.com>
Co-authored-by: Aaqib Ansari <maaquib@gmail.com>
Co-authored-by: Geeta Chauhan <4461127+chauhang@users.noreply.github.com>
Co-authored-by: Aaron Markham <markhama@amazon.com>
  • Loading branch information
5 people committed May 20, 2020
1 parent 7a87176 commit b32a15c
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ The following code completes all three steps:

```bash
curl -O https://s3.amazonaws.com/model-server/inputs/kitten.jpg
curl -X POST http://127.0.0.1:8080/predictions/densenet161 -T kitten.jpg
curl http://127.0.0.1:8080/predictions/densenet161 -T kitten.jpg
```

The predict endpoint returns a prediction response in JSON. It will look something like the following result:
Expand Down
2 changes: 1 addition & 1 deletion docs/batch_inference_with_ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $ curl localhost:8081/models/resnet-152
* Run inference to test the model.

```text
$ curl -X POST localhost/predictions/resnet-152 -T kitten.jpg
$ curl localhost/predictions/resnet-152 -T kitten.jpg
{
"probability": 0.7148938179016113,
"class": "n02123045 tabby, tabby cat"
Expand Down
8 changes: 4 additions & 4 deletions docs/inference_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ To get predictions from the default version of each loaded model, make a REST ca
```bash
curl -O https://s3.amazonaws.com/model-server/inputs/kitten.jpg

curl -X POST http://localhost:8080/predictions/resnet-18 -T kitten.jpg
curl http://localhost:8080/predictions/resnet-18 -T kitten.jpg

or:

curl -X POST http://localhost:8080/predictions/resnet-18 -F "data=@kitten.jpg"
curl http://localhost:8080/predictions/resnet-18 -F "data=@kitten.jpg"
```

To get predictions from a specific version of each loaded model, make a REST call to `/predictions/{model_name}/{version}`:
Expand All @@ -63,11 +63,11 @@ To get predictions from a specific version of each loaded model, make a REST cal
```bash
curl -O https://s3.amazonaws.com/model-server/inputs/kitten.jpg

curl -X POST http://localhost:8080/predictions/resnet-18/2.0 -T kitten.jpg
curl http://localhost:8080/predictions/resnet-18/2.0 -T kitten.jpg

or:

curl -X POST http://localhost:8080/predictions/resnet-18/2.0 -F "data=@kitten.jpg"
curl http://localhost:8080/predictions/resnet-18/2.0 -F "data=@kitten.jpg"
```

The result is JSON that tells you that the image is most likely a tabby cat. The highest prediction was:
Expand Down
2 changes: 1 addition & 1 deletion examples/Huggingface_Transformers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ torchserve --start --model-store model_store --models my_tc=RobertaQA.mar
```

- To run the inference using our registered model, open a new terminal and run: `curl -X POST http://127.0.0.1:8080/predictions/my_tc -T ./sample_text.txt`
- To run the inference using our registered model, open a new terminal and run: `curl http://127.0.0.1:8080/predictions/my_tc -T ./sample_text.txt`
4 changes: 2 additions & 2 deletions examples/image_classifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
mkdir model_store
mv densenet161.mar model_store/
torchserve --start --model-store model_store --models densenet161=densenet161.mar
curl -X POST http://127.0.0.1:8080/predictions/densenet161 -T examples/image_classifier/kitten.jpg
curl http://127.0.0.1:8080/predictions/densenet161 -T examples/image_classifier/kitten.jpg


#### TorchScript example using DenseNet161 image classifier:
Expand Down Expand Up @@ -57,7 +57,7 @@
mkdir model_store
mv densenet161_ts.mar model_store/
torchserve --start --model-store model_store --models densenet161=densenet161_ts.mar
curl -X POST http://127.0.0.1:8080/predictions/densenet161 -T examples/image_classifier/kitten.jpg
curl http://127.0.0.1:8080/predictions/densenet161 -T examples/image_classifier/kitten.jpg
```
#### TorchScript example using custom model and custom handler:

Expand Down
2 changes: 1 addition & 1 deletion examples/image_classifier/mnist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ Run the commands given in following steps from the parent directory of the root
mkdir model_store
mv mnist.mar model_store/
torchserve --start --model-store model_store --models mnist=mnist.mar
curl -X POST http://127.0.0.1:8080/predictions/mnist -T ./serve/examples/image_classifier/mnist/test_data/0.png
curl http://127.0.0.1:8080/predictions/mnist -T ./serve/examples/image_classifier/mnist/test_data/0.png
```

12 changes: 6 additions & 6 deletions examples/image_classifier/resnet_152_batch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ The above commands will create the mar file and register the resnet152 model wit
To test batch inference execute the following commands within the specified max_batch_delay time :

```bash
curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/croco.jpg &
curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/dog.jpg &
curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/kitten.jpg &
curl http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/croco.jpg &
curl http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/dog.jpg &
curl http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/kitten.jpg &
```

#### TorchScript example using Resnet152 batch image classifier:
Expand Down Expand Up @@ -63,7 +63,7 @@ curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/ima
* To test batch inference execute the following commands within the specified max_batch_delay time :

```bash
curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/croco.jpg &
curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/dog.jpg &
curl -X POST http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/kitten.jpg &
curl http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/croco.jpg &
curl http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/dog.jpg &
curl http://127.0.0.1:8080/predictions/resnet152 -T ./serve/examples/image_classifier/resnet_152_batch/images/kitten.jpg &
```
4 changes: 2 additions & 2 deletions examples/image_classifier/resnet_18/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ torch-model-archiver --model-name resnet-18 --version 1.0 --model-file ./serve/e
mkdir model_store
mv resnet-18.mar model_store/
torchserve --start --model-store model_store --models resnet-18=resnet-18.mar
curl -X POST http://127.0.0.1:8080/predictions/resnet-18 -T ./serve/examples/image_classifier/kitten.jpg
curl http://127.0.0.1:8080/predictions/resnet-18 -T ./serve/examples/image_classifier/kitten.jpg
```

#### TorchScript example using Resnet18 image classifier:
Expand Down Expand Up @@ -43,5 +43,5 @@ curl -X POST http://127.0.0.1:8080/predictions/resnet-18 -T ./serve/examples/ima
mkdir model_store
mv resnet-18.mar model_store/
torchserve --start --model-store model_store --models resnet-18=resnet-18.mar
curl -X POST http://127.0.0.1:8080/predictions/resnet-18 -T ./serve/examples/image_classifier/kitten.jpg
curl http://127.0.0.1:8080/predictions/resnet-18 -T ./serve/examples/image_classifier/kitten.jpg
```
2 changes: 1 addition & 1 deletion examples/image_segmenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ wget https://download.pytorch.org/models/fcn_resnet101_coco-7ecb50ca.pth
mkdir model_store
mv fcn_resnet_101.mar model_store/
torchserve --start --model-store model_store --models fcn=fcn_resnet_101.mar
curl -X POST http://127.0.0.1:8080/predictions/fcn -T examples/image_segmenter/fcn/persons.jpg
curl http://127.0.0.1:8080/predictions/fcn -T examples/image_segmenter/fcn/persons.jpg
```
* Output

Expand Down
2 changes: 1 addition & 1 deletion examples/object_detector/fast-rcnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ wget https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_coco-258fb6c6.p
mkdir model_store
mv fastrcnn.mar model_store/
torchserve --start --model-store model_store --models fastrcnn=fastrcnn.mar
curl -X POST http://127.0.0.1:8080/predictions/fastrcnn -T serve/examples/object_detector/persons.jpg
curl http://127.0.0.1:8080/predictions/fastrcnn -T serve/examples/object_detector/persons.jpg
```
* Output

Expand Down
2 changes: 1 addition & 1 deletion examples/object_detector/maskrcnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ wget https://download.pytorch.org/models/maskrcnn_resnet50_fpn_coco-bf2d0c1e.pth
mkdir model_store
mv maskrcnn.mar model_store/
torchserve --start --model-store model_store --models maskrcnn=maskrcnn.mar
curl -X POST http://127.0.0.1:8080/predictions/maskrcnn -T serve/examples/object_detector/persons.jpg
curl http://127.0.0.1:8080/predictions/maskrcnn -T serve/examples/object_detector/persons.jpg
```
* Output

Expand Down
2 changes: 1 addition & 1 deletion examples/text_classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ The above command generated the model's state dict as model.pt and the vocab use
mkdir model_store
mv my_text_classifier.mar model_store/
torchserve --start --model-store model_store --models my_tc=my_text_classifier.mar
curl -X POST http://127.0.0.1:8080/predictions/my_tc -T examples/text_classification/sample_text.txt
curl http://127.0.0.1:8080/predictions/my_tc -T examples/text_classification/sample_text.txt
```
3 changes: 1 addition & 2 deletions examples/text_classification/Transformers_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ torchserve --start --model-store model_store --models my_tc=BertSeqClassificatio
#### Get predictions from a model:

```
curl -X POST http://127.0.0.1:8080/predictions/my_tc -T ./sample_text.txt
curl http://127.0.0.1:8080/predictions/my_tc -T ./sample_text.txt
```

2 changes: 1 addition & 1 deletion examples/text_to_speech_synthesizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pip install librosa --user
```
* Run inference and download audio output using curl command :
```bash
curl -X POST http://127.0.0.1:8080/predictions/waveglow_synthesizer -T sample_text.txt -o audio.wav
curl http://127.0.0.1:8080/predictions/waveglow_synthesizer -T sample_text.txt -o audio.wav
```

* Run inference and download audio output using python script :
Expand Down

0 comments on commit b32a15c

Please sign in to comment.