{"record":{"id":"f6bb3fa0127d9ddb","repo":"microsoft/VibeVoice","slug":"no-valid-content-found-in-text-file","errorCode":null,"errorMessage":"No valid content found in text file","messagePattern":"No valid content found in text file","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/processor/vibevoice_processor.py","lineNumber":592,"sourceCode":"            line = line.strip()\n            if not line:\n                continue\n            \n            # Try to parse as \"Speaker X: text\" format\n            # Use regex to be more robust\n            speaker_match = re.match(r'^Speaker\\s+(\\d+)\\s*:\\s*(.*)$', line, re.IGNORECASE)\n            \n            if speaker_match:\n                speaker_id = int(speaker_match.group(1))\n                text = speaker_match.group(2).strip()\n                if text:\n                    script_lines.append(f\"Speaker {speaker_id}: {text}\")\n            else:\n                # Treat as plain text - assign to current speaker\n                script_lines.append(f\"Speaker {current_speaker}: {line}\")\n        \n        if not script_lines:\n            raise ValueError(\"No valid content found in text file\")\n            \n        return \"\\n\".join(script_lines)\n\n    def _parse_script(self, script: str) -> List[Tuple[int, str]]:\n        \"\"\"Parse script into list of (speaker_id, text) tuples.\"\"\"\n        lines = script.strip().split(\"\\n\")\n        parsed_lines = []\n        speaker_ids = []\n                \n        # First pass: parse all lines and collect speaker IDs\n        for line in lines:\n            if not line.strip():\n                continue\n                \n            # Use regex to handle edge cases like multiple colons\n            match = re.match(r'^Speaker\\s+(\\d+)\\s*:\\s*(.*)$', line.strip(), re.IGNORECASE)\n            \n            if match:","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/processor/vibevoice_processor.py#L574-L610","documentation":"When `text` points at a .txt file, each line is either matched as 'Speaker N: ...' or treated as plain dialogue text assigned to a running speaker. script_lines only stays empty when every line was blank/whitespace, so this error effectively means the text file contains no usable content.","triggerScenarios":"Passing a .txt path that exists but is empty or contains only blank lines/whitespace; pointing at the wrong file (e.g. a placeholder or a truncated download).","commonSituations":"Zero-byte transcript files from a failed download or interrupted export; passing a directory-adjacent file of the same name; files with only a BOM or newline characters.","solutions":["Verify the file has non-blank lines: check file size and open it to confirm content.","If the file legitimately has no dialogue, guard upstream and skip the call instead of feeding an empty transcript.","Re-export or re-download the transcript if it was truncated."],"exampleFix":"# before\nprocessor(text='dialog.txt')  # dialog.txt is empty\n\n# after\n# dialog.txt:\n# Speaker 1: Welcome to the show.\n# Speaker 2: Thanks for having me.\nprocessor(text='dialog.txt')","handlingStrategy":"validation","validationCode":"content = open(text_path).read()\nif not content.strip():\n    raise ValueError(f'transcript file is empty: {text_path}')\nenc = processor(text=text_path)","typeGuard":"def is_nonempty_text_file(path: str) -> bool:\n    return os.path.exists(path) and os.path.getsize(path) > 0","tryCatchPattern":"try:\n    enc = processor(text=text_path)\nexcept ValueError as e:\n    if 'No valid content' in str(e):\n        raise ValueError(f'transcript {text_path} is empty or whitespace-only') from e\n    raise","preventionTips":["Check file size/content before passing paths into the processor.","Validate downloaded transcripts immediately after download, not at inference time.","Skip empty shards explicitly in batch loops."],"tags":["text-file","script","validation","data-quality"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}