{"record":{"id":"1b7f059f65976098","repo":"unslothai/unsloth","slug":"no-valid-examples-after-whisper-preprocessing","errorCode":null,"errorMessage":"No valid examples after Whisper preprocessing","messagePattern":"No valid examples after Whisper preprocessing","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/training/trainer.py","lineNumber":2503,"sourceCode":"                    logger.warning(f\"Error processing Whisper {split_name} example {idx}: {e}\")\n                    skipped += 1\n                    continue\n\n                if (idx + 1) % 100 == 0:\n                    self._update_progress(\n                        status_message = f\"Processing {split_name} audio... {idx + 1}/{len(ds)}\"\n                    )\n\n            logger.info(\n                f\"Whisper {split_name} preprocessing: {len(processed)} examples ({skipped} skipped)\\n\"\n            )\n            return processed\n\n        train_data = process_split(dataset, \"train\")\n        eval_data = process_split(eval_dataset_raw, \"eval\") if eval_dataset_raw else None\n\n        if not train_data:\n            raise ValueError(\"No valid examples after Whisper preprocessing\")\n\n        return (train_data, eval_data)\n\n    @staticmethod\n    def _resolve_local_files(file_paths: list) -> list[str]:\n        \"\"\"Resolve a list of local dataset paths to concrete file paths.\"\"\"\n        all_files: list[str] = []\n        for dataset_file in file_paths:\n            if os.path.isabs(dataset_file):\n                file_path = dataset_file\n            elif os.path.exists(dataset_file):\n                # A path relative to the current working directory (CLI usage)\n                file_path = os.path.abspath(dataset_file)\n            else:\n                file_path = str(resolve_dataset_path(dataset_file))\n\n            file_path_obj = Path(file_path)\n","sourceCodeStart":2485,"sourceCodeEnd":2521,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/training/trainer.py#L2485-L2521","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before: mapped wrong column to text\nmapping = {'audio': 'audio', 'file': 'text'}  # 'file' holds paths, not transcripts\n// after\nmapping = {'audio': 'audio', 'sentence': 'text'}","handlingStrategy":"validation","validationCode":"def whisper_examples_valid(dataset, n=3) -> bool:\n    for i in range(min(n, len(dataset))):\n        a = dataset[i]['audio']\n        t = dataset[i]['text']\n        if not (a.get('array') is not None and len(a['array']) > 0 and isinstance(t, str) and t.strip()):\n            return False\n    return True\n\nassert whisper_examples_valid(dataset), \"Whisper preprocessing would skip all examples\"","typeGuard":null,"tryCatchPattern":"try:\n    train_data, eval_data = trainer._preprocess_whisper_dataset(dataset, mapping, eval_split=True)\nexcept ValueError as e:\n    if 'No valid examples after Whisper preprocessing' in str(e):\n        # check per-split warnings: usually a wrong text mapping or missing audio\n        ...","preventionTips":["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."],"tags":["audio","whisper","asr","dataset","data-quality"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}