PostPruneConfig
Config for post-training prune: select dimensions by weight-based importance (part), then prune.
When passed as training_args.post_prune_config, train() runs post_prune() automatically after training and saves the pruned model. You can also call post_prune() manually when not using this config.
mask
class-attribute
instance-attribute
Optional bool mask of shape (input_dim,). Not serialized in to_dict.
part
class-attribute
instance-attribute
Importance source: 'encoder-weight' | 'decoder-weight' | 'decoder-bias' | 'decoder-sum'.
return_mask
class-attribute
instance-attribute
If True, also return the combined mask from prune.
threshold
class-attribute
instance-attribute
Same as prune(): keep dims with importance >= threshold.
topk
class-attribute
instance-attribute
Same as prune(): int (absolute, top-k dims) or float in (0,1] (relative). topk=1.0 (float) means no pruning. One of topk, threshold, or mask required.