mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-06 10:42:39 +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
|
||||
else:
|
||||
pil_image = PIL_Image.open(io.BytesIO(image.data))
|
||||
return image.data, pil_image.format
|
||||
# data is a base64 encoded string, decode it to bytes first
|
||||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue