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
584e1ab2
Unverified
Commit
584e1ab2
authored
Aug 15, 2025
by
Mick
Committed by
GitHub
Aug 14, 2025
Browse files
fix: fix unsupported palette mode of images in bench_serving for mmmu (#9206)
parent
392de007
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+3
-3
No files found.
python/sglang/bench_serving.py
View file @
584e1ab2
...
...
@@ -864,11 +864,11 @@ def sample_mmmu_requests(
if
image
.
mode
==
"RGBA"
:
image
=
image
.
convert
(
"RGB"
)
# Encode image to base64
# Encode image to base64
(save as PNG to support palette/alpha modes)
buffered
=
io
.
BytesIO
()
image
.
save
(
buffered
,
format
=
"
JPE
G"
)
image
.
save
(
buffered
,
format
=
"
PN
G"
)
img_str
=
pybase64
.
b64encode
(
buffered
.
getvalue
()).
decode
(
"utf-8"
)
image_data
=
f
"data:image/
jpe
g;base64,
{
img_str
}
"
image_data
=
f
"data:image/
pn
g;base64,
{
img_str
}
"
else
:
continue
...
...
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