Skip to content

Commit

Permalink
Update blob.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nmvrs committed Jun 15, 2024
1 parent e0b7107 commit df7c23d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions moai/serve/handlers/azure/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ def __call__(
) -> typing.Any:

if self.json_key not in json:
log.error(f"json key: {self.json_key}, not found in json request")
log.error(f"json key: {self.json_key}, not found in json request")
working_dir = json[self.json_key]


# initialize connection to Azure Blob Storage
connect_str = json[self.connection_string]
try:
Expand Down Expand Up @@ -103,7 +102,7 @@ def __init__(
# self.blob_service_client = BlobServiceClient.from_connection_string(
# connection_string,
# )

self.connection_string = connection_string
self.container_name = container_name
self.blob_paths = blob_paths
Expand All @@ -122,9 +121,9 @@ def __call__(
# NOTE: void is the input json response
# TODO: need to check batched inference
input_json = void[0].get("body") or void[0].get("raw")

if self.json_key not in input_json:
log.error(f"json key: {self.json_key}, not found in json request")
log.error(f"json key: {self.json_key}, not found in json request")
working_dir = input_json[self.json_key]

# initialize connection to Azure Blob Storage
Expand Down

0 comments on commit df7c23d

Please sign in to comment.