Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pm3310 committed Feb 14, 2024
1 parent 3b9b317 commit 0f07f9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sagify/llm_gateway/providers/aws/sagemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ def _invoke_image_creation_endpoint(
) for _base64_string in response_dict['generated_images']
]
)

def _prepare_image_item_response(self, response_format, base64_string):
if response_format == ResponseFormat.URL:
return {
'url':self._generated_image_url(self, base64_string),
'url': self._generated_image_url(self, base64_string),
}
else:
return {
'b64_json': base64_string
}

def _generated_image_url(self, base64_string):
# Decode the base64 string
img_data = base64.b64decode(base64_string)
Expand All @@ -139,7 +139,7 @@ def _generated_image_url(self, base64_string):
self.s3_client.upload_fileobj(buffer, self._bucket_name, key)

# Get the URL of the uploaded image
return f"https://{bucket_name}.s3.amazonaws.com/{key}"
return f"https://{self._bucket_name}.s3.amazonaws.com/{key}"

def _invoke_embeddings_endpoint(self, model, input):
"""
Expand Down

0 comments on commit 0f07f9c

Please sign in to comment.