A LoRA adapter for Gemma 4 (E4B, Instruct) fine-tuned by zehnmindai for Uzbek (uz) automatic speech recognition. Given a short Uzbek speech clip, the model produces a clean text transcription.
unsloth/gemma-4-e4b-it-unsloth-bnb-4bit (pre-quantized 4-bit build of unsloth/gemma-4-E4B-it)uz)SFTTrainerInference is fastest via Unsloth, which loads the base model in 4-bit and attaches this LoRA adapter in a single call.
import librosa
from unsloth import FastModel
from transformers import TextStreamer
# 1. Load base + adapter in 4-bit
model, processor = FastModel.from_pretrained(
model_name = "zehnmindai/gemma_4_uzbek_stt_lora",
max_seq_length = 8192,
load_in_4bit = True,
)
FastModel.for_inference(model)
# 2. Load your Uzbek audio (any sample rate; librosa resamples to 16 kHz)
audio_array, _ = librosa.load("your_uzbek_audio.wav", sr = 16000)
# 3. Build the chat template the model was trained on
messages = [
{
"role": "system",
"content": [{"type": "text",
"text": "You are an assistant that transcribes speech accurately."}],
},
{
"role": "user",
"content": [
{"type": "audio", "audio": audio_array},
{"type": "text", "text": "Please transcribe this audio."},
],
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt = True,
tokenize = True,
return_dict = True,
return_tensors = "pt",
).to("cuda")
# 4. Generate
_ = model.generate(
**inputs,
max_new_tokens = 256,
do_sample = False,
streamer = TextStreamer(processor, skip_prompt = True),
)Expected output for clean speech looks like the following (example): assalomu alaykum. mening ismim Kamoliddin.
In scope
Out of scope / not recommended
The adapter was fine-tuned on a private Uzbek speech corpus curated by zehnmindai, containing ~650,429 audio–transcription pairs spanning varied speakers, recording conditions, and domains. The dataset is not publicly released. Each example was formatted with the Gemma 4 multimodal chat template:
{audio} + "Please transcribe this audio.".r = 8, lora_alpha = 16, lora_dropout = 0bias = "none", use_rslora = Falseq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projpost, linear_start, linear_end, embedding_projection, ffw_layer_1, ffw_layer_2, output_proj| Setting | Value |
|---|---|
| Trainer | TRL SFTTrainer (via Unsloth) |
| Epochs | 1 |
| Total steps | 81,304 |
| Per-device batch size | 8 |
| Gradient accumulation | 1 |
| Learning rate | 5e-5 |
| Scheduler | cosine, warmup ratio 0.03 |
| Optimizer | adamw_8bit |
| Max sequence length | 8,192 |
| Precision | bf16 |
| Seed | 3407 |
| Base quantization | 4-bit (bitsandbytes, via Unsloth) |
unsloth/gemma-4-E4B-it at load time.No formal WER/CER benchmark is published with this release. Before deploying, users are strongly encouraged to evaluate on a held-out set representative of their target domain — for example Uzbek splits of Common Voice or FLEURS — and on in-house recordings.
The LoRA adapter weights in this repository are released under the Apache License 2.0.
The adapter has no value without the base model, and the base model — unsloth/gemma-4-e4b-it-unsloth-bnb-4bit, derived from Google's Gemma 4 — remains subject to the Gemma Terms of Use, including Gemma's prohibited-use policy. By using this adapter together with the base model you agree to both licenses.
If you use this adapter, please cite Gemma and Unsloth, and credit zehnmindai.
@misc{zehnmindai_gemma4_uzbek_stt_lora,
author = {zehnmindai},
title = {Gemma 4 (E4B) Uzbek Speech-to-Text LoRA},
year = {2026},
howpublished = {\url{https://huggingface.co/zehnmindai/gemma_4_uzbek_stt_lora}},
note = {LoRA adapter over unsloth/gemma-4-E4B-it}
}
@misc{gemma_2024,
author = {Google},
title = {Gemma},
year = {2024},
url = {https://ai.google.dev/gemma}
}
@software{unsloth,
author = {Daniel Han and Michael Han and Unsloth team},
title = {Unsloth},
year = {2023},
url = {https://github.com/unslothai/unsloth}
}SFTTrainer.