Instructions to use AbdulElahGwaith/transformers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AbdulElahGwaith/transformers with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AbdulElahGwaith/transformers", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download docs/source/en/quantization/spqr.md from AbdulElahGwaith/transformers: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/AbdulElahGwaith/transformers/resolve/main/docs/source/en/quantization/spqr.md
- Command line
-
hf download hf://AbdulElahGwaith/transformers/docs/source/en/quantization/spqr.md
-
curl -L -o spqr.md https://huggingface.co/AbdulElahGwaith/transformers/resolve/main/docs/source/en/quantization/spqr.md
1.62 kB
SpQR
The SpQR quantization algorithm involves a 16x16 tiled bi-level group 3-bit quantization structure with sparse outliers.
To quantize a model with SpQR, refer to the Vahe1994/SpQR repository.
Load a SpQR-quantized model with [~PreTrainedModel.from_pretrained].
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
quantized_model = AutoModelForCausalLM.from_pretrained(
"elvircrn/Llama-2-7b-SPQR-3Bit-16x16-red_pajama-hf",
dtype=torch.half,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("elvircrn/Llama-2-7b-SPQR-3Bit-16x16-red_pajama-hf")