unslothai/unsloth · error · ValueError
No valid examples after Whisper preprocessing
Error message
No valid examples after Whisper preprocessing
What it means
ValueError raised when the Whisper train split yields zero processed examples — every training row failed feature extraction/tokenization and was skipped during process_split(dataset, 'train'). Unlike the other audio paths this message has no skipped-count and only the train split is fatal; an empty eval split is tolerated. It means the per-example processing failed systemically, with details in the per-example warnings.
Source
Thrown at studio/backend/core/training/trainer.py:2503
logger.warning(f"Error processing Whisper {split_name} example {idx}: {e}")
skipped += 1
continue
if (idx + 1) % 100 == 0:
self._update_progress(
status_message = f"Processing {split_name} audio... {idx + 1}/{len(ds)}"
)
logger.info(
f"Whisper {split_name} preprocessing: {len(processed)} examples ({skipped} skipped)\n"
)
return processed
train_data = process_split(dataset, "train")
eval_data = process_split(eval_dataset_raw, "eval") if eval_dataset_raw else None
if not train_data:
raise ValueError("No valid examples after Whisper preprocessing")
return (train_data, eval_data)
@staticmethod
def _resolve_local_files(file_paths: list) -> list[str]:
"""Resolve a list of local dataset paths to concrete file paths."""
all_files: list[str] = []
for dataset_file in file_paths:
if os.path.isabs(dataset_file):
file_path = dataset_file
elif os.path.exists(dataset_file):
# A path relative to the current working directory (CLI usage)
file_path = os.path.abspath(dataset_file)
else:
file_path = str(resolve_dataset_path(dataset_file))
file_path_obj = Path(file_path)
View on GitHub (pinned to 203007d190)
Solutions
- Check the per-example warnings logged during the split processing for the true exception.
- Validate one row manually: dataset[0]['audio'] decodes and dataset[0]['text'] is a non-empty string.
- Fix the column mapping — the most common cause is mapping a wrong/empty column to 'text'.
- Drop or repair bad rows, then restart training.
Example fix
// before: mapped wrong column to text
mapping = {'audio': 'audio', 'file': 'text'} # 'file' holds paths, not transcripts
// after
mapping = {'audio': 'audio', 'sentence': 'text'} Defensive patterns
Strategy: validation
Validate before calling
def whisper_examples_valid(dataset, n=3) -> bool:
for i in range(min(n, len(dataset))):
a = dataset[i]['audio']
t = dataset[i]['text']
if not (a.get('array') is not None and len(a['array']) > 0 and isinstance(t, str) and t.strip()):
return False
return True
assert whisper_examples_valid(dataset), "Whisper preprocessing would skip all examples" Try / catch
try:
train_data, eval_data = trainer._preprocess_whisper_dataset(dataset, mapping, eval_split=True)
except ValueError as e:
if 'No valid examples after Whisper preprocessing' in str(e):
# check per-split warnings: usually a wrong text mapping or missing audio
... Prevention
- Confirm the mapped 'text' column really contains transcripts (not paths or labels).
- Validate that audio decodes and text is non-empty for sample rows before training.
- Distinguish train vs eval splits when debugging — only an empty train split raises.
When it happens
Trigger: All training rows fail in process_split: audio that cannot be decoded/resampled to 16kHz, empty or null transcripts producing tokenization errors, or audio feature extractor failures (e.g. zero-length clips).
Common situations: Dataset where the text column is actually empty/None for all rows after mapping the wrong column; audio bytes missing (paths/URLs unresolvable); corrupted audio encodings after a partial upload.
Related errors
- No valid examples after DAC preprocessing (skipped {skipped}
- Whisper dataset needs 'audio' and 'text' columns, got: {data
- No valid examples after CSM preprocessing (skipped {skipped}
- No valid examples after SNAC preprocessing (skipped {skipped
- No valid examples after BiCodec preprocessing (skipped {skip
AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15).
Data as JSON: /api/errors/1b7f059f65976098.
Report an issue: GitHub.