Recipes / Call & voicemail transcription
Teach Gemma 4 E4B to handle speech (Unsloth)
Gemma 4 E4B fine-tuned on German speech with matching text, so one small model hears audio directly.
- No license stated
Source: Unsloth notebooks ↗ · by Unsloth · last updated Oct 12, 2026
What a local business could build with it
A single local model that listens to a voicemail and writes it up, in one step. The example is German; the method applies to your own language.
How to run it
Commands are copied from the source, unchanged except where a notebook cell is cut at 40 lines (marked in the code). Placeholders like <you> are the source's own. Credit goes to the authors named on each block.
Install (as written in the notebook)
%%capture
import os, re
if "COLAB_" not in "".join(os.environ.keys()):
!pip install unsloth # Do this in local & cloud setups
else:
!pip install sentencepiece protobuf "datasets==4.3.0" "huggingface_hub>=0.34.0" hf_transfer
!pip install --no-deps unsloth_zoo bitsandbytes accelerate peft trl triton unsloth
!unsloth install-kernels
!pip install --no-deps --upgrade "torchao>=0.16.0"
!pip install --no-deps transformers==5.5.0 "tokenizers>=0.22.0,<=0.23.0"
!pip install "huggingface_hub>=1.5.0,<2.0"
import importlib.metadata as _md
try: _tv = tuple(int(x) for x in _md.version("torch").split("+")[0].split(".")[:2])
except Exception: _tv = (2, 11)
_torchcodec = {(2, 11): "torchcodec>=0.11.0", (2, 10): "torchcodec==0.10.*", (2, 9): "torchcodec==0.9.*", (2, 8): "torchcodec==0.7.*", (2, 7): "torchcodec==0.5.*"}.get(_tv, "torchcodec>=0.12.0" if _tv >= (2, 12) else "torchcodec")
!pip install "{_torchcodec}"
import torch; torch._dynamo.config.recompile_limit = 64;
Load the base model
from unsloth import FastModel
import torch
from huggingface_hub import snapshot_download
fourbit_models = [
# Gemma 4 models
"unsloth/gemma-4-E2B-it",
"unsloth/gemma-4-E2B",
"unsloth/gemma-4-E2B-it",
"unsloth/gemma-4-E4B",
"unsloth/gemma-4-31B-it",
"unsloth/gemma-4-31B",
"unsloth/gemma-4-26B-A4B-it",
"unsloth/gemma-4-26B-A4B",
] # More models at https://huggingface.co/unsloth
model, processor = FastModel.from_pretrained(
model_name = "unsloth/gemma-4-E4B-it",
dtype = None, # None for auto detection
max_seq_length = 8192, # Choose any for long context!
load_in_4bit = True, # 4 bit quantization to reduce memory
full_finetuning = False, # [NEW!] We have full finetuning now!
# token = "YOUR_HF_TOKEN", # HF Token for gated models
)
Set up training
# Use UnslothVisionDataCollator which handles audio token alignment correctly
from unsloth.trainer import UnslothVisionDataCollator
from trl import SFTTrainer, SFTConfig
trainer = SFTTrainer(
model = model,
train_dataset = dataset,
processing_class = processor.tokenizer,
data_collator = UnslothVisionDataCollator(model, processor),
args = SFTConfig(
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4,
warmup_ratio = 0.03,
# num_train_epochs = 1, # Use for full training runs
max_steps = 60,
learning_rate = 5e-5,
logging_steps = 1,
save_strategy = "steps",
optim = "adamw_8bit",
weight_decay = 0.001,
lr_scheduler_type = "cosine",
seed = 3407,
output_dir = "outputs",
report_to = "none",
remove_unused_columns = False,
# The below are a must for audio finetuning:
dataset_text_field = "",
dataset_kwargs = {"skip_prepare_dataset": True},
max_length = 8192,
)
)
Licenses
License flags to read before commercial use:
- Dataset: No license stated. No license stated on the card (the upstream Amphion/Emilia dataset is tagged cc-by-4.0 and gated)
| Part | License, as the source or Hub states it |
|---|---|
| Code | LGPL-3.0 (Unsloth notebooks) |
| Base model | Apache-2.0 |
| Dataset | No license stated on the card (the upstream Amphion/Emilia dataset is tagged cc-by-4.0 and gated) |
Checked against the Hugging Face API and each repo on December 4, 2026. A grouping like “$10M revenue cap” is our shorthand, not legal advice.