Skip to content
Snippets Groups Projects
Commit 67eee02b authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

lint

parent b878018c
No related branches found
No related tags found
1 merge request!54fix artifacts vs cache
Pipeline #44488 passed
......@@ -18,6 +18,7 @@ host = os.getenv('MODEL_HOST')
port = os.getenv('MODEL_PORT')
model = os.getenv('MODEL_NAME')
def make_prediction(instances):
url = f"http://{host}:{port}/v1/models/{model}:predict"
data = json.dumps({"signature_name": "serving_default", "instances": instances.tolist()})
......@@ -25,10 +26,11 @@ def make_prediction(instances):
json_response = requests.post(url, data=data, headers=headers)
try:
predictions = json.loads(json_response.text)['predictions']
except:
except BaseException:
print("prediction failed")
return predictions
async def handle_cameras():
db = SessionLocal()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment