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-base

A LoRA adapter for Gemma 3n E4B โ€” the pretrained, non-instruction-tuned variant โ€” trained for Bambara with Unsloth and TRL.

Adapter weights only. Load onto unsloth/gemma-3n-E4B-unsloth-bnb-4bit; that checkpoint is 4-bit NF4, and the adapter should be loaded onto the same quantised base it was trained against.

Config

Rank r 128
lora_alpha 32
use_rslora true โ€” effective scale is alpha / sqrt(r) โ‰ˆ 2.83, not alpha / r
lora_dropout 0

Adapted: the attention and MLP projections of the 35 decoder layers, the audio tower's attention projections, and โ€” unusually for a LoRA โ€” embed_tokens and lm_head, which is what makes this the vocabulary-adaptation stage.

Usage

import torch
from transformers import AutoProcessor, Gemma3nForConditionalGeneration
from peft import PeftModel

base = Gemma3nForConditionalGeneration.from_pretrained(
    "unsloth/gemma-3n-E4B-unsloth-bnb-4bit",
    dtype=torch.bfloat16,
    device_map="auto",
    attn_implementation="sdpa",
)
model = PeftModel.from_pretrained(base, "djelia/gemma-3n-bm-base")
model.eval()

processor = AutoProcessor.from_pretrained("djelia/gemma-3n-bm-base", padding_side="left")

inputs = processor(text="Bamako ye ", return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(processor.decode(out[0], skip_special_tokens=True))

Notes

This adapter sits on the pretrained base, so use plain text continuation rather than chat formatting.

bitsandbytes and accelerate are required for the 4-bit base. On transformers releases older than the dtype= rename, pass torch_dtype=torch.bfloat16.

Downloads last month
3
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for djelia/gemma-3n-bm-base

Adapter
(1)
this model