mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-07 02:58:21 +00:00
prompt adapter
This commit is contained in:
parent
393d94429c
commit
ff73f0a17b
1 changed files with 4 additions and 2 deletions
|
@ -185,8 +185,10 @@ async def localize_image_content(media: ImageContentItem) -> Tuple[bytes, str]:
|
||||||
|
|
||||||
return content, format
|
return content, format
|
||||||
else:
|
else:
|
||||||
pil_image = PIL_Image.open(io.BytesIO(image.data))
|
# data is a base64 encoded string, decode it to bytes first
|
||||||
return image.data, pil_image.format
|
data_bytes = base64.b64decode(image.data)
|
||||||
|
pil_image = PIL_Image.open(io.BytesIO(data_bytes))
|
||||||
|
return data_bytes, pil_image.format
|
||||||
|
|
||||||
|
|
||||||
async def convert_image_content_to_url(
|
async def convert_image_content_to_url(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue