diff --git a/python/sglang/srt/models/glm4v_moe.py b/python/sglang/srt/models/glm4v_moe.py index 324de18b4..0e77d5b3b 100644 --- a/python/sglang/srt/models/glm4v_moe.py +++ b/python/sglang/srt/models/glm4v_moe.py @@ -281,5 +281,8 @@ class Glm4vMoeForConditionalGeneration(Glm4vForConditionalGeneration): else: logger.warning(f"Parameter {name} not found in params_dict") + if not is_nextn: + self.visual.patch_embed.copy_conv3d_weight_to_linear() + EntryClass = [Glm4vMoeForConditionalGeneration] diff --git a/python/sglang/srt/models/glm_ocr.py b/python/sglang/srt/models/glm_ocr.py index c2f4adc4c..ce1d300ab 100644 --- a/python/sglang/srt/models/glm_ocr.py +++ b/python/sglang/srt/models/glm_ocr.py @@ -431,5 +431,8 @@ class GlmOcrForConditionalGeneration(Glm4vForConditionalGeneration): ) weight_loader(param, loaded_weight) + if not is_nextn: + self.visual.patch_embed.copy_conv3d_weight_to_linear() + EntryClass = [GlmOcrForConditionalGeneration]