Downloads · 30 days
0
binhquoc/alm-add-gemma-non
alm-add-gemma-non is a machine learning model from binhquoc. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Dec 28, 2025
Repo size
36.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors36.9 MB · 100%
From the Hugging Face model README
import torch
from peft import PeftModel
from transformers import AutoProcessor, Qwen2AudioForConditionalGeneration, BitsAndBytesConfig, Gemma3nForConditionalGeneration
model = "google/gemma-3n-E4B-it"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16
)
processor = AutoProcessor.from_pretrained(model,
cache_dir = os.getenv('CACHE_DIR'))
base_model = Gemma3nForConditionalGeneration.from_pretrained(
model,
device_map="auto",
quantization_config=bnb_config,
torch_dtype=torch.bfloat16,
cache_dir = os.getenv('CACHE_DIR')
)
model = PeftModel.from_pretrained(base_model, "binhquoc/alm-add-gemma-non")
model.eval()