From 71959545dfd250eadc2efb2cc2d795445028d761 Mon Sep 17 00:00:00 2001 From: Vincent Zhong <207368749+vincentzed@users.noreply.github.com> Date: Mon, 29 Sep 2025 02:18:29 -0400 Subject: [PATCH] Fix gemma 3 launch with `transformers:` the error: `AttributeError: 'TransformersForCausalLM' object has no attribute 'tp_size'` (#9614) --- python/sglang/srt/models/gemma3_causal.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/sglang/srt/models/gemma3_causal.py b/python/sglang/srt/models/gemma3_causal.py index 5b6145aff..a1c3bc0b1 100644 --- a/python/sglang/srt/models/gemma3_causal.py +++ b/python/sglang/srt/models/gemma3_causal.py @@ -20,7 +20,6 @@ import torch.nn.functional as F from torch import nn from transformers import ( ROPE_INIT_FUNCTIONS, - AutoModel, Gemma3TextConfig, PretrainedConfig, PreTrainedModel, @@ -761,4 +760,3 @@ class Gemma3ForCausalLM(PreTrainedModel): EntryClass = Gemma3ForCausalLM -AutoModel.register(Gemma3TextConfig, Gemma3ForCausalLM, exist_ok=True)