Instructions to use djelia/gemma-3n-bm-it-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use djelia/gemma-3n-bm-it-3 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use djelia/gemma-3n-bm-it-3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for djelia/gemma-3n-bm-it-3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for djelia/gemma-3n-bm-it-3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for djelia/gemma-3n-bm-it-3 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="djelia/gemma-3n-bm-it-3", max_seq_length=2048, )
Configuration Parsing Warning:In adapter_config.json: "peft.task_type" must be a string
gemma-3n-bm-it-3
The third instruction-tuning run for Gemma 3n E4B in Bambara, trained with Unsloth and TRL.
Adapter weights only. Load onto oza75/gemma-3n-bm-it-merged, a bf16 merge of an earlier
stage in this line โ it is not quantised, so load it in bf16.
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 both multimodal embedding projectors.
Usage
import torch
from transformers import AutoProcessor, Gemma3nForConditionalGeneration
from peft import PeftModel
base = Gemma3nForConditionalGeneration.from_pretrained(
"oza75/gemma-3n-bm-it-merged",
dtype=torch.bfloat16,
device_map="auto",
attn_implementation="sdpa",
)
model = PeftModel.from_pretrained(base, "djelia/gemma-3n-bm-it-3")
model.eval()
processor = AutoProcessor.from_pretrained("djelia/gemma-3n-bm-it-3", padding_side="left")
messages = [{"role": "user", "content": [{"type": "text", "text": "I ni ce"}]}]
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 chat template requires strictly alternating user/assistant roles. Audio content items
({"type": "audio", "path": ...}) also work โ the adapter tunes the audio path.
The base is ~16 GB in bf16. If that does not fit, quantise oza75/gemma-3n-bm-it-merged itself
at load time with a BitsAndBytesConfig rather than swapping in a different checkpoint.
- Downloads last month
- 3
Model tree for djelia/gemma-3n-bm-it-3
Unable to build the model tree, the base model loops to the model itself. Learn more.