Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
0a9bfc20
Unverified
Commit
0a9bfc20
authored
May 31, 2025
by
Lifu Huang
Committed by
GitHub
May 31, 2025
Browse files
[Minor] Always append newline after image token when parsing chat message (#6797)
parent
34c63731
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
python/sglang/srt/conversation.py
python/sglang/srt/conversation.py
+5
-8
No files found.
python/sglang/srt/conversation.py
View file @
0a9bfc20
...
...
@@ -562,14 +562,11 @@ def generate_chat_conv(
if
content
.
type
==
"image_url"
:
num_image_url
+=
1
conv
.
modalities
.
append
(
content
.
modalities
)
if
num_image_url
>
1
:
image_token
=
conv
.
image_token
else
:
image_token
=
(
conv
.
image_token
+
"
\n
"
if
conv
.
name
!=
"qwen2-vl"
else
conv
.
image_token
)
image_token
=
(
conv
.
image_token
+
"
\n
"
if
conv
.
name
!=
"qwen2-vl"
else
conv
.
image_token
)
add_token_as_needed
:
bool
=
(
conv
.
name
in
_MODELS_REQUIRING_MODALITY_SUPPLEMENT
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment