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
97fff98c
Unverified
Commit
97fff98c
authored
Sep 09, 2025
by
blzheng
Committed by
GitHub
Sep 08, 2025
Browse files
[CPU] Fix phi4-mm prompt issue in bench_serving (#9900)
parent
ba066ca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+15
-7
No files found.
python/sglang/bench_serving.py
View file @
97fff98c
...
...
@@ -995,17 +995,25 @@ def sample_mmmu_requests(
prompt
=
f
"Question:
{
question
}
\n\n
Answer: "
if
apply_chat_template
:
try
:
is_phi4_multimodal
=
(
"phi-4-multimodal"
in
tokenizer
.
name_or_path
.
lower
()
)
if
is_phi4_multimodal
:
# <|endoftext10|> is the image token used in the phi-4-multimodal model.
content
=
prompt
.
replace
(
"image 1"
,
"<|endoftext10|>"
)
else
:
content
=
[
{
"type"
:
"image_url"
,
"image_url"
:
{
"url"
:
image_data
},
},
{
"type"
:
"text"
,
"text"
:
prompt
},
]
prompt
=
tokenizer
.
apply_chat_template
(
[
{
"role"
:
"user"
,
"content"
:
[
{
"type"
:
"image_url"
,
"image_url"
:
{
"url"
:
image_data
},
},
{
"type"
:
"text"
,
"text"
:
prompt
},
],
"content"
:
content
,
}
],
add_generation_prompt
=
True
,
...
...
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