Downloads · 30 days
6
25% of all-time downloads
Almheiri/Llama-3.2-1B-Instruct-SparseGPT-INT4
Llama-3.2-1B-Instruct-SparseGPT-INT4 is a machine learning model from Almheiri. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Llama 3.2 (1B) Instruct quantized using SparseGPT (4-bit)
Downloads · 30 days
6
25% of all-time downloads
All-time downloads
24
Public
Parameters
1.5B
4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4 GB · 100%
How the weights are stored.
I32973M · 65%
From the Hugging Face model README
Llama 3.2 (1B) Instruct quantized using SparseGPT (4-bit)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Almheiri/Llama-3.2-1B-Instruct-SparseGPT-INT4"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
prompt = [
{"role": "system", "content": "You are a helpful assistant, that responds as a pirate."},
{"role": "user", "content": "What's Deep Learning?"},
]
inputs = tokenizer.apply_chat_template(
prompt,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
).to("cuda")
outputs = model.generate(**inputs, do_sample=True, max_new_tokens=256)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)[0].split("assistant")[-1])