so i have deployed the “Salesforce/blip-image-captioning-base” model on aws sagemaker, i am having trouble with the last part, i don’t know what should be the request format for the json so that i can get the response from the api endpoint on sagemaker.
data = {
"inputs": {
"image": "https://images.unsplash.com/photo-1481349518771-20055b2a7b24?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8cmFuZG9tfGVufDB8fDB8fHww&w=1000&q=80"
}
}
predictor.predict(data)
this is what i am executing and i am getting this exception:
ModelError Traceback (most recent call last)
in
5 }
6
----> 7 predictor.predict(data)/opt/conda/lib/python3.7/site-packages/sagemaker/base_predictor.py in predict(self, data, initial_args, target_model, target_variant, inference_id)
165 data, initial_args, target_model, target_variant, inference_id
166 )
→ 167 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args)
168 return self._handle_response(response)
169/opt/conda/lib/python3.7/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
528 )
529 # The “self” in this scope is referring to the BaseClient.
→ 530 return self._make_api_call(operation_name, kwargs)
531
532 _api_call.name = str(py_operation_name)/opt/conda/lib/python3.7/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
962 error_code = parsed_response.get(“Error”, {}).get(“Code”)
963 error_class = self.exceptions.from_code(error_code)
→ 964 raise error_class(parsed_response, operation_name)
965 else:
966 return parsed_responseModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from primary with message "{
“code”: 400,
“type”: “InternalServerException”,
“message”: “Incorrect format used for image. Should be an url linking to an image, a local path, or a PIL image.”
}