diff --git a/src/guidellm/backend/openai.py b/src/guidellm/backend/openai.py index f75bb3b..90d2791 100644 --- a/src/guidellm/backend/openai.py +++ b/src/guidellm/backend/openai.py @@ -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}) diff --git a/src/guidellm/utils/images.py b/src/guidellm/utils/images.py index 5c5a727..5d73bc0 100644 --- a/src/guidellm/utils/images.py +++ b/src/guidellm/utils/images.py @@ -65,4 +65,4 @@ def load_images(data: str) -> List[ImageDescriptor]: ) ) - return images + return images