Instructions to use djelia/gemma-3n-bm-asr-01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use djelia/gemma-3n-bm-asr-01 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Configuration Parsing Warning:In adapter_config.json: "peft.task_type" must be a string
gemma-3n-bm-asr-01
A LoRA adapter for Gemma 3n E4B-it that adapts the speech path for Bambara, trained with Unsloth and TRL.
Adapter weights only. Load onto unsloth/gemma-3n-E4B-it-unsloth-bnb-4bit — a 4-bit NF4
checkpoint, and the adapter belongs on that same quantised base.
Config
Rank r |
16 |
lora_alpha |
32 |
use_rslora |
false — effective scale alpha / r = 2.0 |
lora_dropout |
0 |
Adapted: the decoder's attention and MLP projections, the 12 audio conformer blocks, and the audio→text embedding projector.
Usage
import torch
from transformers import AutoProcessor, Gemma3nForConditionalGeneration
from peft import PeftModel
base = Gemma3nForConditionalGeneration.from_pretrained(
"unsloth/gemma-3n-E4B-it-unsloth-bnb-4bit",
dtype=torch.bfloat16,
device_map="auto",
attn_implementation="sdpa",
)
model = PeftModel.from_pretrained(base, "djelia/gemma-3n-bm-asr-01")
model.eval()
processor = AutoProcessor.from_pretrained("djelia/gemma-3n-bm-asr-01", padding_side="left")
messages = [{
"role": "user",
"content": [
{"type": "audio", "path": "sample.wav"},
{"type": "text", "text": "Transcribe this audio."},
],
}]
inputs = processor.apply_chat_template(
messages, tokenize=True, return_dict=True,
return_tensors="pt", add_generation_prompt=True,
).to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(processor.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Notes
The processor resamples the audio itself. Gemma 3n's audio encoder emits about 6 tokens per second, so long recordings consume context quickly.
bitsandbytes and accelerate are required for the 4-bit base.
- Downloads last month
- -
Model tree for djelia/gemma-3n-bm-asr-01
Base model
google/gemma-3n-E4B Finetuned
google/gemma-3n-E4B-it Quantized
unsloth/gemma-3n-E4B-it-unsloth-bnb-4bit