microsoft/VibeVoice · error · ValueError
No valid entries found in JSON file
Error message
No valid entries found in JSON file
What it means
After the JSON file passes the 'is a list' check, each entry is validated: non-dicts are skipped with a warning, entries missing 'speaker' or 'text' are skipped, non-integer speaker ids are skipped, and empty/whitespace-only text is dropped. If every entry is filtered out, script_lines is empty and this ValueError fires. The earlier warnings in the log tell you which filter killed the entries.
Source
Thrown at vibevoice/processor/vibevoice_processor.py:554
if speaker is None or text is None:
logger.warning(f"Skipping entry missing speaker or text: {item}")
continue
# Ensure speaker ID is valid
try:
speaker_id = int(speaker)
except (ValueError, TypeError):
logger.warning(f"Invalid speaker ID: {speaker}, skipping entry")
continue
# Clean up text
text = text.strip()
if text:
script_lines.append(f"Speaker {speaker_id}: {text}")
if not script_lines:
raise ValueError("No valid entries found in JSON file")
return "\n".join(script_lines)
def _convert_text_to_script(self, text_file: str) -> str:
"""
Convert text file to script format.
Handles multiple formats:
1. Already formatted as "Speaker X: text"
2. Plain text (assigns to Speaker 1)
Handles edge cases like multiple colons in a line.
"""
with open(text_file, 'r', encoding='utf-8') as f:
lines = f.readlines()
script_lines = []
current_speaker = 1
View on GitHub (pinned to 94da20d98b)
Solutions
- Check the logger.warning lines emitted just before the exception — they name each skipped entry and why.
- Ensure every entry is a dict with 'speaker' as an integer-parseable value and a non-empty 'text'.
- Rename mismatched keys (spk->speaker, transcript->text) with a small jq/python pass before calling the processor.
Example fix
# before
[{"spk": "1", "transcript": "Hi"}]
# after
[{"speaker": "1", "text": "Hi"}] Defensive patterns
Strategy: validation
Validate before calling
import json
data = json.load(open(path))
valid = [{'speaker': int(e['speaker']), 'text': e['text'].strip()}
for e in data
if isinstance(e, dict) and e.get('speaker') and e.get('text', '').strip()
and str(e['speaker']).isdigit()]
if not valid:
raise ValueError('transcript has no usable entries — check speaker/text keys') Type guard
def is_valid_entry(e) -> bool:
return (isinstance(e, dict) and str(e.get('speaker', '')).isdigit()
and bool(str(e.get('text', '')).strip())) Try / catch
try:
enc = processor(text=json_path)
except ValueError as e:
if 'No valid entries' in str(e):
logger.error('transcript schema mismatch; expected speaker:int + text:str entries')
raise
raise Prevention
- Pre-validate entries with the same rules (int speaker, non-empty text) before the call.
- Enable logging to see per-entry skip warnings that precede the exception.
- Pin the transcript schema in your data contracts to avoid key renames.
When it happens
Trigger: A JSON list where all entries have speaker ids like 'speaker_1' or 'one' (int() fails), or all texts are empty strings, or all entries use different keys ('spk'/'utterance' instead of 'speaker'/'text').
Common situations: Schema drift: annotation tools renaming fields; speaker names instead of numeric ids ('narrator'); transcripts where text is stored under 'transcript' rather than 'text'.
Related errors
- JSON file must contain a list of speaker entries
- No valid content found in text file
- Audio input is required for ASR processing
- Could not process input text: {text}
- No valid speaker lines found in script
AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15).
Data as JSON: /api/errors/71ea277bf5a03b35.
Report an issue: GitHub.