Skip to content

Commit

Permalink
Quality fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarques committed Nov 5, 2024
1 parent a441dad commit 570670b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/guidellm/backend/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _build_messages(self, request: TextGenerationRequest) -> Dict:
stream = io.BytesIO()
im_format = image.image.format or "PNG"
image.image.save(stream, format=im_format)
im_b64 = base64.b64encode(stream.getvalue()).decode("ascii")
im_b64 = base64.b64encode(stream.getvalue()).decode("utf-8")
image_url = {"url": f"data:image/{im_format.lower()};base64,{im_b64}"}
content.append({"type": "image_url", "image_url": image_url})

Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/utils/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def load_images(data: str) -> List[ImageDescriptor]:
)
)

return images
return images

0 comments on commit 570670b

Please sign in to comment.