mirror of
https://github.com/huggingface/transformers.git
synced 2025-10-20 17:13:56 +08:00
@ -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
|
||||
# between modelings (because they are prefixed with the model name)
|
||||
elif (
|
||||
isinstance(
|
||||
module, (nn.LayerNorm, nn.RMSNorm, nn.GroupNorm, nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d)
|
||||
)
|
||||
isinstance(module, (nn.GroupNorm, nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d))
|
||||
or "LayerNorm" in module.__class__.__name__
|
||||
or "RMSNorm" in module.__class__.__name__
|
||||
):
|
||||
|
Reference in New Issue
Block a user