Remove unused config field from Gemma2 (#36672)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-03-11 08:51:19 +00:00
committed by GitHub
parent e568cf88bc
commit f4ae58b38b

View File

@@ -63,7 +63,6 @@ class Gemma2MLP(nn.Module):
self,
hidden_size: int,
intermediate_size: int,
hidden_act: str,
hidden_activation: str,
quant_config: QuantizationConfig | None = None,
prefix: str = "",
@@ -83,11 +82,10 @@ class Gemma2MLP(nn.Module):
quant_config=quant_config,
prefix=f"{prefix}.down_proj",
)
if not (hidden_act == hidden_activation == "gelu_pytorch_tanh"):
if not (hidden_activation == "gelu_pytorch_tanh"):
raise ValueError(
"Gemma2 uses `gelu_pytorch_tanh` as the hidden activation "
"function. Please set `hidden_act` and `hidden_activation` to "
"`gelu_pytorch_tanh`."
"function. Please set `hidden_activation` to `gelu_pytorch_tanh`."
)
self.act_fn = GeluAndMul(approximate="tanh")
@@ -212,7 +210,6 @@ class Gemma2DecoderLayer(nn.Module):
self.mlp = Gemma2MLP(
hidden_size=self.hidden_size,
intermediate_size=config.intermediate_size,
hidden_act=config.hidden_act,
hidden_activation=config.hidden_activation,
quant_config=quant_config,
prefix=f"{prefix}.mlp",