Views
No views yet
LlamaQuantized1from transformers.models.llama import LlamaTokenizer
2from chop.models.manual.llama_quantized import (
3 LlamaQuantizedConfig,
4 LlamaQuantizedForCausalLM,
5)
6
7name="Cheng98/llama-160m"
8tokenizer = LlamaTokenizer.from_pretrained(name)
9
10# override the quant_config to quantized the model
11# default does not quantize llama
12config = LlamaQuantizedConfig.from_pretrained(
13 name,
14 # quant_config="./quant_config_na.toml"
15
16)
17
18llama = LlamaQuantizedForCausalLM.from_pretrained(
19 name,
20 config=config,
21)