Unverified Commit 640cc9dd authored by allgather's avatar allgather Committed by GitHub
Browse files

feat: Add LoRA support for Gemma4ForConditionalGeneration (#39291)


Signed-off-by: default avatarallgather <all2allops@gmail.com>
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent ceade195
...@@ -67,6 +67,7 @@ from vllm.utils.tensor_schema import TensorSchema, TensorShape ...@@ -67,6 +67,7 @@ from vllm.utils.tensor_schema import TensorSchema, TensorShape
from .interfaces import ( from .interfaces import (
MultiModalEmbeddings, MultiModalEmbeddings,
SupportsEagle3, SupportsEagle3,
SupportsLoRA,
SupportsMultiModal, SupportsMultiModal,
SupportsPP, SupportsPP,
) )
...@@ -880,6 +881,7 @@ class Gemma4ForConditionalGeneration( ...@@ -880,6 +881,7 @@ class Gemma4ForConditionalGeneration(
nn.Module, nn.Module,
SupportsMultiModal, SupportsMultiModal,
SupportsPP, SupportsPP,
SupportsLoRA,
SupportsEagle3, SupportsEagle3,
): ):
packed_modules_mapping = { packed_modules_mapping = {
...@@ -1358,10 +1360,16 @@ class Gemma4ForConditionalGeneration( ...@@ -1358,10 +1360,16 @@ class Gemma4ForConditionalGeneration(
def get_mm_mapping(self) -> MultiModelKeys: def get_mm_mapping(self) -> MultiModelKeys:
"""Get the module prefix mapping for multimodal models.""" """Get the module prefix mapping for multimodal models."""
connectors = ["embed_vision"]
tower_models = ["vision_tower"]
if self.audio_tower is not None:
connectors.append("embed_audio")
tower_models.append("audio_tower")
return MultiModelKeys.from_string_field( return MultiModelKeys.from_string_field(
language_model="language_model", language_model="language_model",
connector=["embed_vision", "embed_audio"], connector=connectors,
tower_model=["vision_tower", "audio_tower"], tower_model=tower_models,
) )
@classmethod @classmethod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment