Unverified Commit f4ae58b3 authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

Remove unused config field from Gemma2 (#36672)


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent e568cf88
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment