PULSE-2B-LoRA

PULSE-2B is a lightweight, high-performance fine-tuned version of Google's Gemma 2 2B Instruct model. Trained locally on Apple Silicon using Low-Rank Adaptation (LoRA) via MLX, this adapter improves instruction-following and system behaviors with minimal memory usage.

  • Base Model: mlx-community/gemma-2-2b-it-4bit
  • Framework: MLX / Apple Silicon Unified Memory
  • Training Iterations: 600
  • Final Loss: 2.53

πŸ› οΈ Requirements & Installation

Make sure you are on a Mac with Apple Silicon (M1/M2/M3/M4) running macOS.

pip install -U mlx-lm huggingface_hub

πŸš€ Quickstart Tutorials

Option 1: Using MLX Command Line Interface (CLI)

1. Text Generation

You can run generation directly without fusing the model weights:

mlx_lm.generate \
  --model mlx-community/gemma-2-2b-it-4bit \
  --adapter-path YOUR_USERNAME/PULSE-2B-LoRA \
  --prompt "Instruction:\nGive me 3 practical tips for time management.\n\nResponse:\n" \
  --max-tokens 200

2. Interactive Terminal Chat

Launch an interactive session directly in your terminal:

mlx_lm.chat \
  --model mlx-community/gemma-2-2b-it-4bit \
  --adapter-path YOUR_USERNAME/PULSE-2B-LoRA

Option 2: Using Python API (mlx_lm)

You can easily load the base model and adapter inside Python scripts or Jupyter Notebooks:

from mlx_lm import load, generate

# 1. Load the base quantized model alongside the LoRA adapter
model, tokenizer = load(
    "mlx-community/gemma-2-2b-it-4bit",
    adapter_path="YOUR_USERNAME/PULSE-2B-LoRA"
)

# 2. Format the prompt
prompt = "Instruction:\nExplain quantum computing in simple terms.\n\nResponse:\n"

# 3. Generate response
response = generate(
    model, 
    tokenizer, 
    prompt=prompt, 
    max_tokens=250, 
    verbose=True
)

print(response)

Option 3: Using Hugging Face peft & transformers (PyTorch)

If you converted or adapted these weights for standard PyTorch/Transformers workflows, you can load them with peft:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "google/gemma-2-2b-it"
adapter_id = "YOUR_USERNAME/PULSE-2B-LoRA"

# 1. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

# 2. Attach LoRA Adapter
model = PeftModel.from_pretrained(base_model, adapter_id)

# 3. Generate
inputs = tokenizer("Instruction:\nWrite a 4-line poem about rain.\n\nResponse:\n", return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
outputs = model.generate(**inputs, max_new_tokens=100)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

πŸ“œ Notice & License

PULSE-2B is a derivative work based on Google's Gemma 2 weights and is governed by the official Gemma Terms of Use.


Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for muonai/PULSE-2B-LoRa-adapters

Adapter
(512)
this model