Skip to content

Commit

Permalink
0.38.2: fix multi-image for ovis1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
matatonic committed Oct 9, 2024
1 parent c092d15 commit 426e6c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/ovis16.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ def __init__(self, model_id: str, device: str, device_map: str = 'auto', extra_p
async def stream_chat_with_images(self, request: ImageChatRequest) -> AsyncGenerator[str, None]:
conversation = []
images = []

for m in request.messages:
content = ''
for c in m.content:
if c.type == 'image_url':
image = await url_to_image(c.image_url.url)
images.extend([image])
content = IMAGE_TOKEN + '\n' + content
content += IMAGE_TOKEN + '\n'
elif c.type == 'text':
content += c.text

Expand Down

0 comments on commit 426e6c5

Please sign in to comment.