Instructions to use mdimamhosen/pd-mel-gemma4-e4b-reasoning-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use mdimamhosen/pd-mel-gemma4-e4b-reasoning-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-e4b-it-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "mdimamhosen/pd-mel-gemma4-e4b-reasoning-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
PD Mel Gemma4 E4B Reasoning LoRA
LoRA adapter that teaches Gemma 4 E4B to write step-by-step visual reasoning over Mel spectrograms of voice recordings, conditioned on the ground-truth class (healthy or parkinsons).
Built for Parkinson’s voice / speech-signal explainability (EDGE research). Teacher traces were generated with Gemma 4 31B; this student is the deployable ~4B-class Unsloth QLoRA fine-tune.
Quick facts
| Base | unsloth/gemma-4-e4b-it-unsloth-bnb-4bit |
| Type | Vision–language LoRA (PEFT) |
| Task | Mel image + class label → reasoning trace |
| LoRA | r=32, α=32 |
| Train | ~1134 Mel samples, 1 epoch / 270 steps, loss ≈ 0.30 |
| Framework | Unsloth + TRL SFT |
Intended use
- Research demos and papers on explainable PD vs healthy Mel analysis
- Not a clinical diagnostic device — labels are assumed given; model explains why the spectrogram fits the label
Output format
{REASONING_START}
1. ...
2. ...
3. ...
{REASONING_END}
Example (conceptual)
Input: Mel PNG of a sustained vowel + text Class label: parkinsons
Output: Numbered visual cues (harmonic instability, breathiness texture, formant blur, etc.) inside the reasoning tags.
How to load
from unsloth import FastVisionModel
from PIL import Image
model, processor = FastVisionModel.from_pretrained(
"HF_USER/pd-mel-gemma4-e4b-reasoning-lora",
load_in_4bit=True,
)
FastVisionModel.for_inference(model)
Or load this folder locally after download.
Training data (summary)
- Mel spectrogram images (
healthy/parkinsons) - Assistant targets: reasoning-only traces from
google/gemma-4-31B-it(4-bit teacher on Kaggle T4×2)
Limitations
- Depends on correct class label in the prompt
- Visual reasoning can be plausible but not ground-truth physiology
- 4-bit base + LoRA; not a full merged FP16 dump unless you merge yourself
Citation
EDGE Parkinson Mel reasoning fine-tune (Gemma 4 E4B Unsloth LoRA). Guide: https://unsloth.ai/docs/models/gemma-4/train
- Downloads last month
- -