Skip to content

Commit

Permalink
fix(ray): append mime type for image output (#208)
Browse files Browse the repository at this point in the history
Because

- allow receiver to properly render image

This commit

- append mime type for image output
  • Loading branch information
heiruwu authored Sep 9, 2024
1 parent 297f1f1 commit 9e38b70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions instill/helpers/ray_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@ def construct_task_text_to_image_output(
"""Construct trigger output for text to image task
Args:
images (List[List[str]]): for each input prompt, the generated images with the length of `samples`
images (List[List[str]]): for each input prompt,
the generated jpeg image base64 string with the length of `samples`
"""

if not len(finish_reasons) == len(images):
Expand All @@ -922,7 +923,7 @@ def construct_task_text_to_image_output(
choices.append(
{
"finish-reason": finish,
"image": img,
"image": f"data:image/jpeg;base64,{img}",
}
)
data["choices"] = choices
Expand Down

0 comments on commit 9e38b70

Please sign in to comment.