Skip to content

Commit

Permalink
fixes #51: fix bug with request import
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxence Guindon committed Feb 14, 2024
1 parent 559c66b commit d1aa60a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import time
import azure_storage.azure_storage_api as azure_storage_api
import model_inference.inference as inference
import model_request.model_request as req
import model_request.model_request as reqt
from custom_exceptions import (
DeleteDirectoryRequestError,
ListDirectoriesRequestError,
Expand Down Expand Up @@ -201,13 +201,13 @@ async def inference_request():
if isinstance(image_bytes, list):
result_json = []
for img in image_bytes:
req = await req.request_factory(img, endpoint_url, endpoint_api_key, model_name)
req = await reqt.request_factory(img, endpoint_url, endpoint_api_key, model_name)
response = urllib.request.urlopen(req)
result = response.read()
result_json.append(json.loads(result.decode("utf-8")))

elif isinstance(image_bytes, str):
req = await req.request_factory(image_bytes, endpoint_url, endpoint_api_key, model_name)
req = await reqt.request_factory(image_bytes, endpoint_url, endpoint_api_key, model_name)
response = urllib.request.urlopen(req)
result = response.read()
result_json = json.loads(result.decode("utf-8"))
Expand Down

0 comments on commit d1aa60a

Please sign in to comment.