Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
this doesnt exist in v5 anymore (maybe for encoder tho but not for de…
…coder)
  • Loading branch information
3outeille committed Dec 15, 2025
commit 33f7e576f664493f6a533857dda53bff3a5a4ce9
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,6 @@ def init_weights(self, *args, **kwargs):
# This method replicates the behavior of the original PreTrainedModel.init_weights,
# but with a custom weight initialization function that skips nn.Identity modules (when PP is enabled)

if self.model.config.pruned_heads:
logger.info("Pruning heads as per model configuration.")
self.model.prune_heads(self.model.config.pruned_heads)

original_init_weights_fn = self.model._init_weights

def selective_init(module):
Expand Down