In the example below, we aren't handling the failure scenario for remote API calls (which can fail). Need to provide explicit handling of these cases - should likely extract a unit-of-work pattern here to help with testing.
|
response = await httpclient.AsyncHTTPClient().fetch( |
|
method="POST", |
|
body=test_data.read(), |
|
request=apiUrl, |
|
headers={ |
|
"Prediction-Key": self.predictionKey, |
|
"Content-Type": "application/octet-stream" |
|
}, |
|
raise_error=False |
|
) |
|
results = json.loads(response.body.decode()) |
In the example below, we aren't handling the failure scenario for remote API calls (which can fail). Need to provide explicit handling of these cases - should likely extract a unit-of-work pattern here to help with testing.
CustomVisionParallelScoring/src/ModelScoring.py
Lines 49 to 59 in b597ce2