Downloads · 30 days
63
12% of all-time downloads
onekq-ai/starcoder2-3b-bnb-4bit
starcoder2-3b-bnb-4bit is a text generation model from onekq-ai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as bigcode-openrail-m.
Bitsandbytes quantization of https://huggingface.co/bigcode/starcoder2-3b.
Downloads · 30 days
63
12% of all-time downloads
All-time downloads
511
Public
Parameters
3.1B
1.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.8 GB · 100%
How the weights are stored.
U83B · 95%
From the Hugging Face model README
Bitsandbytes quantization of https://huggingface.co/bigcode/starcoder2-3b.
See https://huggingface.co/blog/4bit-transformers-bitsandbytes for instructions.
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import BitsAndBytesConfig
import torch
nf4_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16
)
model = AutoModelForCausalLM.from_pretrained("bigcode/starcoder2-3b", quantization_config=nf4_config)
tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-3b")
model.push_to_hub("onekq-ai/starcoder2-3b-bnb-4bit")
tokenizer.push_to_hub("onekq-ai/starcoder2-3b-bnb-4bit")