Skip to content

Commit 3c187d4

Browse files
committed
gemma3n lora
Signed-off-by: NickLucche <[email protected]>
1 parent 43c146c commit 3c187d4

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

docs/models/supported_models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ th {
366366
| `GemmaForCausalLM` | Gemma | `google/gemma-2b`, `google/gemma-1.1-2b-it`, etc. | ✅︎ | ✅︎ | ✅︎ |
367367
| `Gemma2ForCausalLM` | Gemma 2 | `google/gemma-2-9b`, `google/gemma-2-27b`, etc. | ✅︎ | ✅︎ | ✅︎ |
368368
| `Gemma3ForCausalLM` | Gemma 3 | `google/gemma-3-1b-it`, etc. | ✅︎ | ✅︎ | ✅︎ |
369-
| `Gemma3nForCausalLM` | Gemma 3n | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | | | ✅︎ |
369+
| `Gemma3nForCausalLM` | Gemma 3n | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | ✅︎ | | ✅︎ |
370370
| `GlmForCausalLM` | GLM-4 | `zai-org/glm-4-9b-chat-hf`, etc. | ✅︎ | ✅︎ | ✅︎ |
371371
| `Glm4ForCausalLM` | GLM-4-0414 | `zai-org/GLM-4-32B-0414`, etc. | ✅︎ | ✅︎ | ✅︎ |
372372
| `Glm4MoeForCausalLM` | GLM-4.5, GLM-4.6 | `zai-org/GLM-4.5`, etc. | ✅︎ | ✅︎ | ✅︎ |
@@ -671,7 +671,7 @@ These models primarily accept the [`LLM.generate`](./generative_models.md#llmgen
671671
| `Ernie4_5_VLMoeForConditionalGeneration` | Ernie4.5-VL | T + I<sup>+</sup>/ V<sup>+</sup> | `baidu/ERNIE-4.5-VL-28B-A3B-PT`, `baidu/ERNIE-4.5-VL-424B-A47B-PT` | | ✅︎ | ✅︎ |
672672
| `FuyuForCausalLM` | Fuyu | T + I | `adept/fuyu-8b`, etc. | | ✅︎ | ✅︎ |
673673
| `Gemma3ForConditionalGeneration` | Gemma 3 | T + I<sup>+</sup> | `google/gemma-3-4b-it`, `google/gemma-3-27b-it`, etc. | ✅︎ | ✅︎ | ⚠️ |
674-
| `Gemma3nForConditionalGeneration` | Gemma 3n | T + I + A | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | | | ✅︎ |
674+
| `Gemma3nForConditionalGeneration` | Gemma 3n | T + I + A | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | ✅︎ | | ✅︎ |
675675
| `GLM4VForCausalLM`<sup>^</sup> | GLM-4V | T + I | `zai-org/glm-4v-9b`, `zai-org/cogagent-9b-20241220`, etc. | ✅︎ | ✅︎ | ✅︎ |
676676
| `Glm4vForConditionalGeneration` | GLM-4.1V-Thinking | T + I<sup>E+</sup> + V<sup>E+</sup> | `zai-org/GLM-4.1V-9B-Thinking`, etc. | ✅︎ | ✅︎ | ✅︎ |
677677
| `Glm4vMoeForConditionalGeneration` | GLM-4.5V | T + I<sup>E+</sup> + V<sup>E+</sup> | `zai-org/GLM-4.5V`, etc. | ✅︎ | ✅︎ | ✅︎ |

vllm/model_executor/models/gemma3n_mm.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import torch
88

99
from torch import nn
10+
1011
from transformers import AutoModel, BatchFeature
1112
from transformers.models.gemma3n import (
1213
Gemma3nAudioConfig,
@@ -54,14 +55,10 @@
5455
from vllm.sequence import IntermediateTensors
5556
from vllm.utils.tensor_schema import TensorSchema, TensorShape
5657

57-
from .interfaces import MultiModalEmbeddings, SupportsMultiModal, SupportsTranscription
58-
from .utils import (
59-
AutoWeightsLoader,
60-
WeightsMapper,
61-
flatten_bn,
62-
init_vllm_registered_model,
63-
maybe_prefix,
64-
)
58+
from .interfaces import (MultiModalEmbeddings, SupportsLoRA, SupportsMultiModal,
59+
SupportsTranscription)
60+
from .utils import (AutoWeightsLoader, WeightsMapper, flatten_bn,
61+
init_vllm_registered_model, maybe_prefix)
6562

6663
logger = init_logger(__name__)
6764

@@ -456,14 +453,11 @@ def forward(
456453
return self.embedding_post_projection_norm(emb_norm_proj)
457454

458455

459-
@MULTIMODAL_REGISTRY.register_processor(
460-
Gemma3nMultiModalProcessor,
461-
info=Gemma3nProcessingInfo,
462-
dummy_inputs=Gemma3nDummyInputsBuilder,
463-
)
464-
class Gemma3nForConditionalGeneration(
465-
nn.Module, SupportsMultiModal, SupportsTranscription
466-
):
456+
@MULTIMODAL_REGISTRY.register_processor(Gemma3nMultiModalProcessor,
457+
info=Gemma3nProcessingInfo,
458+
dummy_inputs=Gemma3nDummyInputsBuilder)
459+
class Gemma3nForConditionalGeneration(nn.Module, SupportsMultiModal,
460+
SupportsTranscription, SupportsLoRA):
467461
merge_by_field_config = True
468462
supported_languages = ISO639_1_SUPPORTED_LANGS
469463

0 commit comments

Comments
 (0)