How to use from the
Use from the
PEFT library
# Gated model: Login with a HF token with gated access permission
hf auth login
Task type is invalid.

You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

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
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for djelia/gemma-3n-bm-asr-01

Adapter
(4)
this model