由zehnmindai为乌兹别克语(uz)自动语音识别微调的Gemma 4(E4B,指令型) LoRA适配器。给定一段乌兹别克语语音片段,该模型可生成清晰的文本转录结果。
unsloth/gemma-4-e4b-it-unsloth-bnb-4bit(unsloth/gemma-4-E4B-it的预量化4位版本)uz)SFTTrainer通过Unsloth进行推理速度最快,它能以4位精度加载基础模型,并通过单次调用附加此LoRA适配器。
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),
)清晰语音的预期输出如下(示例):assalomu alaykum. mening ismim Kamoliddin.
适用范围
不适用范围/不推荐用途
适配器在zehnmindai精心整理的私有乌兹别克语语音语料库上进行了微调,包含约650,429个音频-转录对,涵盖不同的说话人、录音条件和领域。该数据集未公开。每个样本均采用Gemma 4多模态聊天模板进行格式化:
{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| 设置 | 值 |
|---|---|
| 训练器 | TRL SFTTrainer(通过Unsloth) |
| 轮次 | 1 |
| 总步数 | 81,304 |
| 每设备批大小 | 8 |
| 梯度累积 | 1 |
| 学习率 | 5e-5 |
| 调度器 | cosine,预热比例0.03 |
| 优化器 | adamw_8bit |
| 最大序列长度 | 8,192 |
| 精度 | bf16 |
| 种子 | 3407 |
| 基础量化 | 4-bit(bitsandbytes,通过Unsloth) |
unsloth/gemma-4-E4B-it。此版本未发布正式的 WER/CER 基准测试结果。在部署前,强烈建议用户在其目标领域的预留数据集上进行评估 — 例如 Common Voice 或 FLEURS 的乌兹别克语拆分数据集 — 以及内部录制的音频。
本仓库中的 LoRA 适配器权重根据 Apache License 2.0 发布。
没有基础模型,适配器就没有价值,而基础模型 — unsloth/gemma-4-e4b-it-unsloth-bnb-4bit,衍生自 Google 的 Gemma 4 — 仍受 Gemma 使用条款 约束,包括 Gemma 的禁止使用政策。将此适配器与基础模型一起使用,即表示您同意这两个许可。
如果您使用此适配器,请引用 Gemma 和 Unsloth,并注明 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。