Skip to content

Commit d1a55c6

Browse files
committed
gemma3n lora
Signed-off-by: NickLucche <[email protected]>
1 parent 9701352 commit d1a55c6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docs/models/supported_models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ th {
350350
| `GemmaForCausalLM` | Gemma | `google/gemma-2b`, `google/gemma-1.1-2b-it`, etc. | ✅︎ | ✅︎ | ✅︎ |
351351
| `Gemma2ForCausalLM` | Gemma 2 | `google/gemma-2-9b`, `google/gemma-2-27b`, etc. | ✅︎ | ✅︎ | ✅︎ |
352352
| `Gemma3ForCausalLM` | Gemma 3 | `google/gemma-3-1b-it`, etc. | ✅︎ | ✅︎ | ✅︎ |
353-
| `Gemma3nForCausalLM` | Gemma 3n | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | | | ✅︎ |
353+
| `Gemma3nForCausalLM` | Gemma 3n | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | ✅︎ | | ✅︎ |
354354
| `GlmForCausalLM` | GLM-4 | `zai-org/glm-4-9b-chat-hf`, etc. | ✅︎ | ✅︎ | ✅︎ |
355355
| `Glm4ForCausalLM` | GLM-4-0414 | `zai-org/GLM-4-32B-0414`, etc. | ✅︎ | ✅︎ | ✅︎ |
356356
| `Glm4MoeForCausalLM` | GLM-4.5 | `zai-org/GLM-4.5`, etc. | ✅︎ | ✅︎ | ✅︎ |
@@ -624,7 +624,7 @@ These models primarily accept the [`LLM.generate`](./generative_models.md#llmgen
624624
| `Florence2ForConditionalGeneration` | Florence-2 | T + I | `microsoft/Florence-2-base`, `microsoft/Florence-2-large`, etc. | | | |
625625
| `FuyuForCausalLM` | Fuyu | T + I | `adept/fuyu-8b`, etc. | | ✅︎ | ✅︎ |
626626
| `Gemma3ForConditionalGeneration` | Gemma 3 | T + I<sup>+</sup> | `google/gemma-3-4b-it`, `google/gemma-3-27b-it`, etc. | ✅︎ | ✅︎ | ⚠️ |
627-
| `Gemma3nForConditionalGeneration` | Gemma 3n | T + I + A | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | | | ✅︎ |
627+
| `Gemma3nForConditionalGeneration` | Gemma 3n | T + I + A | `google/gemma-3n-E2B-it`, `google/gemma-3n-E4B-it`, etc. | ✅︎ | | ✅︎ |
628628
| `GLM4VForCausalLM`<sup>^</sup> | GLM-4V | T + I | `zai-org/glm-4v-9b`, `zai-org/cogagent-9b-20241220`, etc. | ✅︎ | ✅︎ | ✅︎ |
629629
| `Glm4vForConditionalGeneration` | GLM-4.1V-Thinking | T + I<sup>E+</sup> + V<sup>E+</sup> | `zai-org/GLM-4.1V-9B-Thinking`, etc. | ✅︎ | ✅︎ | ✅︎ |
630630
| `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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
import torch
77
from torch import nn
8+
89
from transformers import AutoModel, BatchFeature
910
from transformers.models.gemma3n import (Gemma3nAudioConfig,
1011
Gemma3nAudioFeatureExtractor,
1112
Gemma3nConfig, Gemma3nProcessor,
1213
Gemma3nTextConfig,
1314
Gemma3nVisionConfig)
1415
from transformers.models.siglip import SiglipImageProcessorFast
15-
1616
from vllm.config import VllmConfig
1717
from vllm.logger import init_logger
1818
from vllm.model_executor.layers.layernorm import RMSNorm
@@ -40,7 +40,7 @@
4040
from vllm.multimodal.profiling import BaseDummyInputsBuilder
4141
from vllm.sequence import IntermediateTensors
4242

43-
from .interfaces import MultiModalEmbeddings, SupportsMultiModal
43+
from .interfaces import MultiModalEmbeddings, SupportsLoRA, SupportsMultiModal
4444
from .utils import (AutoWeightsLoader, WeightsMapper, flatten_bn,
4545
init_vllm_registered_model, maybe_prefix,
4646
merge_multimodal_embeddings)
@@ -410,7 +410,8 @@ def forward(
410410
@MULTIMODAL_REGISTRY.register_processor(Gemma3nMultiModalProcessor,
411411
info=Gemma3nProcessingInfo,
412412
dummy_inputs=Gemma3nDummyInputsBuilder)
413-
class Gemma3nForConditionalGeneration(nn.Module, SupportsMultiModal):
413+
class Gemma3nForConditionalGeneration(nn.Module, SupportsMultiModal,
414+
SupportsLoRA):
414415
packed_modules_mapping = {
415416
"qkv_proj": [
416417
"q_proj",

0 commit comments

Comments
 (0)