feat: Add LoRA support for Gemma4ForConditionalGeneration (#39291)
Signed-off-by: allgather <all2allops@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
ceade1952c
commit
640cc9dd7d
@@ -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(
|
|||||||
nn.Module,
|
nn.Module,
|
||||||
SupportsMultiModal,
|
SupportsMultiModal,
|
||||||
SupportsPP,
|
SupportsPP,
|
||||||
|
SupportsLoRA,
|
||||||
SupportsEagle3,
|
SupportsEagle3,
|
||||||
):
|
):
|
||||||
packed_modules_mapping = {
|
packed_modules_mapping = {
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user