Downloads · 30 days
13
7% of all-time downloads
tokenlabsdotrun/Llama-3.1-8B-Quanto-Int8
Llama-3.1-8B-Quanto-Int8 is a text generation model from tokenlabsdotrun. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.1.
This is a quantized version of meta-llama/Llama-3.1-8B-Instruct using quanto with INT8 weight quantization.
Downloads · 30 days
13
7% of all-time downloads
All-time downloads
175
Public
Parameters
8B
17.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.6 GB · 100%
How the weights are stored.
I87.5B · 93%
From the Hugging Face model README
This is a quantized version of meta-llama/Llama-3.1-8B-Instruct using quanto with INT8 weight quantization.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from quanto import quantize, freeze, qint8, safe_load
# Load base model structure
model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-3.1-8B-Instruct",
torch_dtype=torch.bfloat16,
low_cpu_mem_usage=True
)
# Quantize structure and load weights
quantize(model, weights=qint8)
state_dict = safe_load("model.safetensors") # Use quanto's safe_load
model.load_state_dict(state_dict)
freeze(model)
# Load tokenizer and generate
tokenizer = AutoTokenizer.from_pretrained("tokenlabsdotrun/Llama-3.1-8B-Quanto-Int8")
inputs = tokenizer("Hello, my name is", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=10)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model inherits the Llama 3.1 Community License.