Instructions to use Angshul/higher-order-pruner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Angshul/higher-order-pruner with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Angshul/higher-order-pruner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 468 Bytes
cdfcfcf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | """Model-agnostic higher-order pruning for PyTorch linear layers."""
from .core import PruneConfig, PruneReport, discover_linear_groups, prune
from .hf import causal_lm_loss, load_causal_lm, prepare_texts, prune_hf_model
from .pruner import HigherOrderPruner
__all__ = [
"HigherOrderPruner",
"PruneConfig",
"PruneReport",
"discover_linear_groups",
"prune",
"prune_hf_model",
"load_causal_lm",
"prepare_texts",
"causal_lm_loss",
]
|