A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 10, 12:45 UTC
[Model] Enable LoRA support for tower and connector in GLM4-V (#31652)
Signed-off-by: Zyyeric <eric1976808123@gmail.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
Zyyeric committed
Jan 8, 2026 at 01:45 UTC
63baa28cf5a95788f0a9237721b9d569bce39148
1 file changed
+14
vllm/model_executor/models/glm4_1v.py
+14
@@ -1788,6 +1788,20 @@ class Glm4vForConditionalGeneration(
1788
tower_model="visual.",
1789
)
1790
1791
+ def get_num_mm_encoder_tokens(
1792
+ self,
1793
+ num_image_tokens: int,
1794
+ ) -> int:
1795
+ merge_size = self.config.vision_config.spatial_merge_size
1796
+ return num_image_tokens * (merge_size**2)
1797
+
1798
+ def get_num_mm_connector_tokens(
1799
+ self,
1800
+ num_vision_tokens: int,
1801
+ ) -> int:
1802
+ merge_size = self.config.vision_config.spatial_merge_size
1803
+ return num_vision_tokens // (merge_size**2)
1804
+
1805
1806
@MULTIMODAL_REGISTRY.register_processor(
1807
Glm4vMultiModalProcessor,