Skip to content

Commit

Permalink
Update server docs to use v2 infer endpoints (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoin authored Apr 17, 2024
1 parent 1ff44cd commit 9f9d165
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/use-cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/sentiment_analysis/infer'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/cv/embedding-extraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ deepsparse.server --config_file config.yaml
Make requests to the server:
```python
import requests, json
url = "http://0.0.0.0:5543/predict/from_files"
url = "http://0.0.0.0:5543/v2/models/embedding_extraction-0/infer/from_files"
paths = ["lion.jpeg"]
files = [("request", open(img, 'rb')) for img in paths]
resp = requests.post(url=url, files=files)
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/cv/image-segmentation-yolact.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Run inference:
import requests
import json

url = 'http://0.0.0.0:5543/predict/from_files'
url = 'http://0.0.0.0:5543/v2/models/yolact/infer/from_files'
path = ['thailand.jpeg'] # list of images for inference
files = [('request', open(img, 'rb')) for img in path]
resp = requests.post(url=url, files=files)
Expand Down Expand Up @@ -217,7 +217,7 @@ Run inference:
import requests
import json

url = 'http://0.0.0.0:5543/predict/from_files'
url = 'http://0.0.0.0:5543/v2/models/yolact/infer/from_files'
path = ['thailand.jpeg'] # list of images for inference
files = [('request', open(img, 'rb')) for img in path]
resp = requests.post(url=url, files=files)
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/cv/object-detection-yolov5.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Making a request.
import requests
import json

url = 'http://0.0.0.0:5543/predict/from_files'
url = 'http://0.0.0.0:5543/v2/models/yolo/infer/from_files'
path = ['basilica.jpg'] # list of images for inference
files = [('request', open(img, 'rb')) for img in path]
resp = requests.post(url=url, files=files)
Expand Down Expand Up @@ -271,7 +271,7 @@ Making a request:
```python
import requests, json

url = 'http://0.0.0.0:5543/predict/from_files'
url = 'http://0.0.0.0:5543/v2/models/yolo/infer/from_files'
path = ['basilica.jpg'] # list of images for inference
files = [('request', open(img, 'rb')) for img in path]
resp = requests.post(url=url, files=files)
Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/general/scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Run inference:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/sentiment_analysis/infer'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/nlp/question-answering.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Here is an example client request, using the Python requests library for formatt
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/question_answering/infer'

# send the data
obj = {
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/nlp/sentiment-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Here is an example client request, using the Python `requests` library for forma
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/sentiment_analysis/infer'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
Expand Down Expand Up @@ -297,7 +297,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/sentiment_analysis/infer'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
Expand Down
15 changes: 8 additions & 7 deletions docs/use-cases/nlp/text-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/text_classification/infer'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
Expand All @@ -351,14 +351,15 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = "http://0.0.0.0:5543/v2/models/text_classification/infer"

# send the data
obj = {
"sequences": [[
"The text classification pipeline is fast and easy to use!",
"The pipeline for text classification makes it simple to get started"
]]}
"sequences": [
["The pipeline for text classification makes it simple to get started"],
["The text classification pipeline is fast and easy to use!"],
]
}
resp = requests.post(url=url, json=obj)

# recieve the post-processed output
Expand Down Expand Up @@ -391,7 +392,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/text_classification/infer'

# send the data
obj = {"sequences": "Sending requests to DeepSparse Server is fast and easy!"}
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/nlp/token-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Here is an example client request, using the Python requests library for formatt
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/token_classification/infer'
# send the data
obj = {"inputs": "Mary is flying from Nairobi to New York to attend a conference"}
resp = requests.post(url=url, json=obj)
Expand Down Expand Up @@ -261,7 +261,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/token_classification/infer'

# send the data
obj = {"inputs": "Mary is flying from Nairobi to New York to attend a conference",}
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/nlp/transformers-embedding-extraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Here is an example client request, using the Python `requests` library for forma
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/transformers_embedding_extraction/infer'

# send the data
obj = {"inputs": "The transformers embedding extraction Pipeline is the best!"}
Expand Down Expand Up @@ -191,7 +191,7 @@ Making requests:
```python
import requests, json
# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/transformers_embedding_extraction/infer'

# send the data
obj = {"inputs": "The transformers embedding extraction Pipeline is the best!"}
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/nlp/zero-shot-text-classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/zero_shot_text_classification/infer'

# send the data
obj = {
Expand Down Expand Up @@ -238,7 +238,7 @@ Making a request:
import requests

# Uvicorn is running on this port
url = 'http://0.0.0.0:5543/predict'
url = 'http://0.0.0.0:5543/v2/models/zero_shot_text_classification/infer'

# send the data
obj = {"sequences": ["The Boston Red Sox are my favorite baseball team!"]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ import requests, json
path = ['basilica.jpg']
files = [('request', open(img, 'rb')) for img in path]

# send request over HTTP to /predict/from_files endpoint
url = 'http://0.0.0.0:5543/predict/from_files'
# send request over HTTP to /v2/models/yolo/infer/from_files endpoint
url = 'http://0.0.0.0:5543/v2/models/yolo/infer/from_files'
resp = requests.post(url=url, files=files)

# response is returned in JSON
Expand Down

0 comments on commit 9f9d165

Please sign in to comment.