Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import json
import requests
# create a json string to ask query to the depoyed model
data = json.dumps({"signature_name": "serving_default",
"instances": test_images[0:3].tolist()})
# headers for the post request
headers = {"content-type": "application/json"}
# make the post request
json_response = requests.post('http://localhost:9000/v1/models/sample/versions/1:predict',
data=data,
headers=headers)
# get the predictions
predictions = json.loads(json_response.text)
predictions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.