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
b4734b95
Unverified
Commit
b4734b95
authored
Nov 20, 2025
by
Alex Brooks
Committed by
GitHub
Nov 21, 2025
Browse files
[Bugfix] Fix default MM LoRA alignment for single str prompts (#29140)
Signed-off-by:
Alex-Brooks
<
Alex.Brooks@ibm.com
>
parent
30b9c677
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
tests/lora/test_default_mm_loras.py
tests/lora/test_default_mm_loras.py
+35
-0
vllm/entrypoints/llm.py
vllm/entrypoints/llm.py
+1
-1
No files found.
tests/lora/test_default_mm_loras.py
View file @
b4734b95
...
...
@@ -5,7 +5,9 @@ Tests for applying default registered multimodal loras.
"""
import
os
import
unittest.mock
as
mock
import
pytest
from
huggingface_hub
import
snapshot_download
from
vllm.lora.request
import
LoRARequest
...
...
@@ -114,3 +116,36 @@ def test_default_mm_lora_fails_with_overridden_lora_request(
default_mm_loras
=
{
"audio"
:
IMAGE_LORA_PATH
},
expected_suffix
=
RESPONSE_SUFFIX_WITH_LORA
,
)
def
test_default_mm_lora_does_not_expand_string_reqs
(
vllm_runner
):
class
MockEngineException
(
Exception
):
pass
# Regression test for ensuring default multimodal lora resolution
# does not expand the lora req if the prompt type is a string.
vllm_runner_kwargs
=
{
**
VLLM_RUNNER_BASE_KWARGS
,
**
{
"default_mm_loras"
:
{
"audio"
:
AUDIO_LORA_PATH
}},
}
# Avoid the full generation call since these tests are expensive;
# just check what lora request is actually submitted to the engine
mock_err
=
"Engine is mocked for this test"
with
(
mock
.
patch
(
"vllm.v1.engine.llm_engine.LLMEngine.add_request"
,
side_effect
=
MockEngineException
(
mock_err
),
)
as
mock_add_request
,
vllm_runner
(
**
vllm_runner_kwargs
)
as
vllm_model
,
):
# Die once we actually submit the request to the engine
with
pytest
.
raises
(
MockEngineException
):
vllm_model
.
llm
.
generate
(
prompts
=
AUDIO_PROMPT
)
# Then check to make sure the submitted lora request
# and text prompt were zipped together correctly
engine_args
,
engine_kwargs
=
mock_add_request
.
call_args
assert
engine_kwargs
[
"lora_request"
]
is
None
assert
engine_kwargs
[
"prompt_text"
]
==
AUDIO_PROMPT
vllm/entrypoints/llm.py
View file @
b4734b95
...
...
@@ -466,7 +466,7 @@ class LLM:
):
return
lora_request
if
not
isinstance
(
prompts
,
Sequence
):
if
not
isinstance
(
prompts
,
Sequence
)
or
isinstance
(
prompts
,
str
)
:
prompts
=
[
prompts
]
optional_loras
=
(
...
...
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