"git@developer.sourcefind.cn:change/sglang.git" did not exist on "619bb6ddda39cada67f75426979b77e7b42bb15e"
Unverified Commit 0a9bfc20 authored by Lifu Huang's avatar Lifu Huang Committed by GitHub
Browse files

[Minor] Always append newline after image token when parsing chat message (#6797)

parent 34c63731
...@@ -562,14 +562,11 @@ def generate_chat_conv( ...@@ -562,14 +562,11 @@ def generate_chat_conv(
if content.type == "image_url": if content.type == "image_url":
num_image_url += 1 num_image_url += 1
conv.modalities.append(content.modalities) conv.modalities.append(content.modalities)
if num_image_url > 1: image_token = (
image_token = conv.image_token conv.image_token + "\n"
else: if conv.name != "qwen2-vl"
image_token = ( else conv.image_token
conv.image_token + "\n" )
if conv.name != "qwen2-vl"
else conv.image_token
)
add_token_as_needed: bool = ( add_token_as_needed: bool = (
conv.name in _MODELS_REQUIRING_MODALITY_SUPPLEMENT conv.name in _MODELS_REQUIRING_MODALITY_SUPPLEMENT
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment