diff --git a/python/sglang/srt/models/gemma4_unified.py b/python/sglang/srt/models/gemma4_unified.py index 67d0771d4..610f0c20c 100644 --- a/python/sglang/srt/models/gemma4_unified.py +++ b/python/sglang/srt/models/gemma4_unified.py @@ -190,7 +190,8 @@ class Gemma4UnifiedForConditionalGeneration(Gemma4ForConditionalGeneration): ) text_tie = getattr(text_config, "tie_word_embeddings", True) - if self.pp_group.world_size == 1 and text_tie: + self.lm_head_is_tied = self.pp_group.world_size == 1 and text_tie + if self.lm_head_is_tied: self.lm_head = self.language_model.embed_tokens elif self.pp_group.is_last_rank: self.lm_head = ParallelLMHead(