Transformers documentation

SpQR

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v5.22.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

SpQR

SpQR量子化アルゴリズムは、スパースな外れ値を伴う16x16タイル化の2レベルグループ3ビット量子化構造を含みます。

SpQRでモデルを量子化するには、Vahe1994/SpQRリポジトリを参照してください。

from_pretrained() で SpQR 量子化モデルを読み込みます。

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")
Update on GitHub