Bitsandbytes quantization of https://huggingface.co/NovaSky-AI/Sky-T1-32B-Preview.
See https://huggingface.co/blog/4bit-transformers-bitsandbytes for instructions.
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import BitsAndBytesConfig
import torch
# Define the 4-bit configuration
nf4_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16
)
# Load the pre-trained model with the 4-bit quantization configuration
model = AutoModelForCausalLM.from_pretrained("NovaSky-AI/Sky-T1-32B-Preview", quantization_config=nf4_config)
# Load the tokenizer associated with the model
tokenizer = AutoTokenizer.from_pretrained("NovaSky-AI/Sky-T1-32B-Preview")
# Push the model and tokenizer to the Hugging Face hub
model.push_to_hub("onekq-ai/Sky-T1-32B-Preview-bnb-4bit", use_auth_token=True)
tokenizer.push_to_hub("onekq-ai/Sky-T1-32B-Preview-bnb-4bit", use_auth_token=True)
- Downloads last month
- 4
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.
Model tree for onekq-ai/Sky-T1-32B-Preview-bnb-4bit
Base model
Qwen/Qwen2.5-32B
Finetuned
Qwen/Qwen2.5-32B-Instruct
Finetuned
NovaSky-AI/Sky-T1-32B-Preview