@@ -2881,9 +2881,7 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
|
|||||||
# We cannot use `isinstance` on the RMSNorms or LayerNorms, as they usually are custom modules which change names
|
# We cannot use `isinstance` on the RMSNorms or LayerNorms, as they usually are custom modules which change names
|
||||||
# between modelings (because they are prefixed with the model name)
|
# between modelings (because they are prefixed with the model name)
|
||||||
elif (
|
elif (
|
||||||
isinstance(
|
isinstance(module, (nn.GroupNorm, nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d))
|
||||||
module, (nn.LayerNorm, nn.RMSNorm, nn.GroupNorm, nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d)
|
|
||||||
)
|
|
||||||
or "LayerNorm" in module.__class__.__name__
|
or "LayerNorm" in module.__class__.__name__
|
||||||
or "RMSNorm" in module.__class__.__name__
|
or "RMSNorm" in module.__class__.__name__
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user