Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
0c31e28e
Unverified
Commit
0c31e28e
authored
Aug 21, 2025
by
Cyrus Leung
Committed by
GitHub
Aug 20, 2025
Browse files
[Bugfix] Fix extra whitespace in strings caused by newline (#23272)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
f571ff8e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
27 deletions
+30
-27
benchmarks/benchmark_dataset.py
benchmarks/benchmark_dataset.py
+4
-2
examples/offline_inference/vision_language.py
examples/offline_inference/vision_language.py
+7
-8
vllm/benchmarks/datasets.py
vllm/benchmarks/datasets.py
+4
-2
vllm/model_executor/model_loader/tpu.py
vllm/model_executor/model_loader/tpu.py
+6
-5
vllm/model_executor/models/hyperclovax_vision.py
vllm/model_executor/models/hyperclovax_vision.py
+4
-5
vllm/model_executor/models/phi4mm.py
vllm/model_executor/models/phi4mm.py
+3
-3
vllm/transformers_utils/configs/eagle.py
vllm/transformers_utils/configs/eagle.py
+2
-2
No files found.
benchmarks/benchmark_dataset.py
View file @
0c31e28e
...
...
@@ -958,8 +958,10 @@ class InstructCoderDataset(HuggingFaceDataset):
for
i
,
item
in
enumerate
(
self
.
data
):
if
len
(
sampled_requests
)
>=
num_requests
:
break
prompt
=
f
"
{
item
[
'input'
]
}
\n\n
{
item
[
'instruction'
]
}
Just output
\
the code, do not include any explanation."
prompt
=
(
f
"
{
item
[
'input'
]
}
\n\n
{
item
[
'instruction'
]
}
Just output "
"the code, do not include any explanation."
)
# apply template
prompt
=
tokenizer
.
apply_chat_template
(
...
...
examples/offline_inference/vision_language.py
View file @
0c31e28e
...
...
@@ -283,8 +283,10 @@ def run_glm4v(questions: list[str], modality: str) -> ModelRequestData:
)
prompts
=
[
f
"<|user|>
\n
<|begin_of_image|><|endoftext|><|end_of_image|>
\
{
question
}
<|assistant|>"
(
"<|user|>
\n
<|begin_of_image|><|endoftext|><|end_of_image|>"
f
"
{
question
}
<|assistant|>"
)
for
question
in
questions
]
...
...
@@ -767,15 +769,13 @@ def run_llava_next_video(questions: list[str], modality: str) -> ModelRequestDat
def
run_llava_onevision
(
questions
:
list
[
str
],
modality
:
str
)
->
ModelRequestData
:
if
modality
==
"video"
:
prompts
=
[
f
"<|im_start|>user <video>
\n
{
question
}
<|im_end|>
\
<|im_start|>assistant
\n
"
f
"<|im_start|>user <video>
\n
{
question
}
<|im_end|><|im_start|>assistant
\n
"
for
question
in
questions
]
elif
modality
==
"image"
:
prompts
=
[
f
"<|im_start|>user <image>
\n
{
question
}
<|im_end|>
\
<|im_start|>assistant
\n
"
f
"<|im_start|>user <image>
\n
{
question
}
<|im_end|><|im_start|>assistant
\n
"
for
question
in
questions
]
...
...
@@ -998,8 +998,7 @@ def run_molmo(questions: list[str], modality: str) -> ModelRequestData:
)
prompts
=
[
f
"<|im_start|>user <image>
\n
{
question
}
<|im_end|>
\
<|im_start|>assistant
\n
"
f
"<|im_start|>user <image>
\n
{
question
}
<|im_end|><|im_start|>assistant
\n
"
for
question
in
questions
]
...
...
vllm/benchmarks/datasets.py
View file @
0c31e28e
...
...
@@ -1289,8 +1289,10 @@ class InstructCoderDataset(HuggingFaceDataset):
for
i
,
item
in
enumerate
(
self
.
data
):
if
len
(
sampled_requests
)
>=
num_requests
:
break
prompt
=
f
"
{
item
[
'input'
]
}
\n\n
{
item
[
'instruction'
]
}
Just output
\
the code, do not include any explanation."
prompt
=
(
f
"
{
item
[
'input'
]
}
\n\n
{
item
[
'instruction'
]
}
Just output "
"the code, do not include any explanation."
)
# apply template
prompt
=
tokenizer
.
apply_chat_template
(
...
...
vllm/model_executor/model_loader/tpu.py
View file @
0c31e28e
...
...
@@ -98,14 +98,15 @@ class TPUModelLoader(DefaultModelLoader):
# Check parameters
for
name
,
param
in
model
.
named_parameters
():
assert
param
.
device
.
type
==
device_type
,
f
"Parameter
{
name
}
is on
\
{
param
.
device
.
type
}
instead of
{
device_type
}
"
assert
param
.
device
.
type
==
device_type
,
(
f
"Parameter
{
name
}
is on
{
param
.
device
.
type
}
"
f
"instead of
{
device_type
}
"
)
# Check buffers
for
name
,
buffer
in
model
.
named_buffers
():
assert
buffer
.
device
.
type
==
device_type
,
\
f
"Buffer
{
name
}
is on
{
buffer
.
device
.
type
}
instead of
\
{
device_type
}
"
assert
buffer
.
device
.
type
==
device_type
,
(
f
"Buffer
{
name
}
is on
{
buffer
.
device
.
type
}
"
f
"instead of
{
device_type
}
"
)
for
module
in
model
.
modules
():
if
(
mesh
is
not
None
)
and
(
get_fqn
(
module
)
==
'QKVParallelLinear'
):
...
...
vllm/model_executor/models/hyperclovax_vision.py
View file @
0c31e28e
...
...
@@ -929,8 +929,8 @@ class HCXVisionForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
target_group_size
=
0
elif
video_group_size
<
target_group_size
:
raise
RuntimeError
(
f
"video_group_size < target_group_size!!
\
[
{
video_group_size
}
<
{
target_group_size
}
]
"
)
raise
RuntimeError
(
f
"
{
video_group_size
=
}
<
{
target_group_size
=
}
"
)
assert
len
(
target_features
)
==
0
,
f
"target_features is not empty!!
{
target_features
}
"
...
...
@@ -1114,9 +1114,8 @@ def reshape_and_unpad_image_features(
base_image_feature
=
image_feature
[
0
]
image_feature
=
image_feature
[
1
:]
assert
(
height
*
width
==
base_image_feature
.
shape
[
0
]
),
f
"height:
{
height
}
, width:
{
width
}
,
\
base_image_feature.shape[0]:
{
base_image_feature
.
shape
[
0
]
}
"
assert
height
*
width
==
base_image_feature
.
shape
[
0
],
(
f
"
{
height
=
}
*
{
width
=
}
!=
{
base_image_feature
.
shape
[
0
]
=
}
"
)
num_patch_width
,
num_patch_height
=
get_anyres_image_grid_shape
(
image_size
,
possible_resolutions
,
grid_size
)
...
...
vllm/model_executor/models/phi4mm.py
View file @
0c31e28e
...
...
@@ -262,9 +262,9 @@ class Phi4MMImageEncoder(nn.Module):
img_features
.
shape
[
1
]))
assert
base_feat_height
==
base_feat_height_target
\
and
base_feat_width
==
base_feat_height_target
,
\
f
'
base_feat_height:
{
base_feat_height
}
,"
\
f"
base_feat_width:
{
base_feat_width
}
, "
\
f"expect
{
base_feat_height_target
}
features for hd transform
'
(
f
"
base_feat_height:
{
base_feat_height
}
,
"
f
"base_feat_width:
{
base_feat_width
}
, "
f
"expect
{
base_feat_height_target
}
features for hd transform
"
)
# bs x max_num_crops x (24x24) x C
img_features
=
img_features
.
view
(
bs
,
-
1
,
...
...
vllm/transformers_utils/configs/eagle.py
View file @
0c31e28e
...
...
@@ -61,8 +61,8 @@ class EAGLEConfig(PretrainedConfig):
else
f
"Eagle3
{
arch
}
"
for
arch
in
self
.
model
.
architectures
]
else
:
raise
ValueError
(
f
"Invalid method
{
method
}
.
\
Supported methods are eagle and eagle3."
)
raise
ValueError
(
f
"Invalid method
{
method
}
.
"
"
Supported methods are eagle and eagle3."
)
super
().
__init__
(
**
kwargs
)
...
...
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