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
Download higher_order_pruner/__init__.py from Angshul/higher-order-pruner: direct link, hf CLI and curl.
- Browser
- Download file 468 Bytes
-
https://huggingface.co/Angshul/higher-order-pruner/resolve/main/higher_order_pruner/__init__.py
- Command line
-
hf download hf://Angshul/higher-order-pruner/higher_order_pruner/__init__.py
-
curl -L -o __init__.py https://huggingface.co/Angshul/higher-order-pruner/resolve/main/higher_order_pruner/__init__.py
468 Bytes
| """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", | |
| ] | |