d
gcw_GYGYTJUF/gemma-4-uzbek-stt-lora
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

zehnmindai Gemma 4 (E4B) — Uzbek Speech-to-Text (LoRA)

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.

  • Developed by: zehnmindai
  • Model type: LoRA adapter over a multimodal (audio + text) instruct model
  • Base model: unsloth/gemma-4-e4b-it-unsloth-bnb-4bit (pre-quantized 4-bit build of unsloth/gemma-4-E4B-it)
  • Task: Automatic Speech Recognition (audio → Uzbek text)
  • Language: Uzbek (uz)
  • License: Apache-2.0 (adapter weights). The base Gemma 4 model remains subject to Google's Gemma Terms of Use.
  • Training framework: Unsloth + TRL SFTTrainer
  • Trained 2× faster with Unsloth.

Quick start

Inference 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.


Intended use

In scope

  • Transcribing short-to-medium Uzbek speech clips (conversational, read speech).
  • Building Uzbek voice interfaces, dictation tools, captioning pipelines, and data-annotation assistants.
  • Research on multimodal Gemma variants for low-resource languages.

Out of scope / not recommended

  • Text-to-speech or voice cloning (this model is ASR-only).
  • Languages other than Uzbek; the adapter was trained exclusively on Uzbek audio.
  • Long-form transcription beyond the 8,192-token context window without chunking.
  • Safety-critical, medical, legal, or biometric identification use cases.
  • Transcribing audio in conditions very different from the training distribution (heavy code-switching, extreme noise, very low bitrate telephony) without downstream evaluation.

Training data

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:

  1. System: transcription instruction.
  2. User: {audio} + "Please transcribe this audio.".
  3. Assistant: the reference transcription.

Training procedure

LoRA configuration

  • r = 8, lora_alpha = 16, lora_dropout = 0
  • bias = "none", use_rslora = False
  • Target modules (language tower): q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Target modules (audio tower): post, linear_start, linear_end, embedding_projection, ffw_layer_1, ffw_layer_2, output_proj

Supervised fine-tuning

SettingValue
TrainerTRL SFTTrainer (via Unsloth)
Epochs1
Total steps81,304
Per-device batch size8
Gradient accumulation1
Learning rate5e-5
Schedulercosine, warmup ratio 0.03
Optimizeradamw_8bit
Max sequence length8,192
Precisionbf16
Seed3407
Base quantization4-bit (bitsandbytes, via Unsloth)

Hardware & footprint

  • GPU: NVIDIA GeForce RTX 5090 Laptop GPU (24 GB)
  • Peak VRAM: ~9.4 GB during training (4-bit base + LoRA)
  • Shipped artifact: LoRA adapter only — the base weights are not redistributed. You need network access to unsloth/gemma-4-E4B-it at load time.

Evaluation

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.


Limitations and bias

  • Dialect and accent coverage is bounded by the training corpus; less common dialects or strong accents may transcribe with reduced accuracy.
  • Noisy audio, far-field microphones, telephony codecs, and heavy code-switching (Uzbek ↔ Russian/English) can degrade quality.
  • The model inherits Gemma 4's general limitations and biases; it is not calibrated for factuality and should not be treated as a source of truth beyond the literal transcription task.
  • Because it is an instruction-tuned LLM with an ASR head, off-distribution prompts may yield non-transcription behavior. Keep the chat template shown above.

License

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.


Citation

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

Acknowledgements

  • Google — for releasing the Gemma 4 base model.
  • Unsloth — for the fast 4-bit fine-tuning stack that made this training run fit on a single laptop GPU.
  • Hugging Face TRL — for SFTTrainer.
  • zehnmindai — for dataset curation, training, and release.

Framework versions

  • PEFT 0.18.1