Gemma-4-MLX
Collection
1 item • Updated
How to use harishkumar12k/gemma-4-E2B-it-mlx-2Bit with Transformers:
# Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("harishkumar12k/gemma-4-E2B-it-mlx-2Bit")
model = AutoModelForImageTextToText.from_pretrained("harishkumar12k/gemma-4-E2B-it-mlx-2Bit")How to use harishkumar12k/gemma-4-E2B-it-mlx-2Bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir gemma-4-E2B-it-mlx-2Bit harishkumar12k/gemma-4-E2B-it-mlx-2Bit
The Model harishkumar12k/gemma-4-E2B-it-mlx-2Bit was converted to MLX format from google/gemma-4-E2B-it using mlx-lm version 0.31.2.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("harishkumar12k/gemma-4-E2B-it-mlx-2Bit")
prompt="hello"
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)
2-bit