mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
address comments
This commit is contained in:
parent
a720928a1c
commit
790f21459a
1 changed files with 3 additions and 1 deletions
|
@ -121,7 +121,9 @@ async def interleaved_content_convert_to_raw(
|
||||||
if c.url.uri.startswith("data"):
|
if c.url.uri.startswith("data"):
|
||||||
match = re.match(r"data:image/(\w+);base64,(.+)", c.url.uri)
|
match = re.match(r"data:image/(\w+);base64,(.+)", c.url.uri)
|
||||||
if not match:
|
if not match:
|
||||||
raise ValueError("Invalid data URL format")
|
raise ValueError(
|
||||||
|
f"Invalid data URL format, {c.url.uri[:40]}..."
|
||||||
|
)
|
||||||
_, image_data = match.groups()
|
_, image_data = match.groups()
|
||||||
data = base64.b64decode(image_data)
|
data = base64.b64decode(image_data)
|
||||||
elif c.url.uri.startswith("file://"):
|
elif c.url.uri.startswith("file://"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue