Skip to content

Commit 489bb15

Browse files
authored
Update internvl.py to fix #3528 (#3837)
1 parent d81b4de commit 489bb15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lmdeploy/vl/model/internvl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ def proc_messages(
240240
continue
241241
n_images = len([1 for x in message['content'] if x['type'] == 'image'])
242242
content = [x.get('text', '') for x in message['content'] if x['type'] == 'text']
243+
if len(content) == 0:
244+
content.append('')
243245
prompt = content[0]
244246
if IMAGE_TOKEN in prompt and f'<img>{IMAGE_TOKEN}' not in prompt:
245247
prompt = prompt.replace(f'{IMAGE_TOKEN}', f'<img>{IMAGE_TOKEN}</img>')

0 commit comments

Comments
 (0)