v1.2 — Script Review Pass & Bug Fixes
Alexandria v1.2 — Script Review Pass & Bug Fixes
A new LLM-powered script review feature that catches common annotation errors, plus critical fixes for CPU users and Windows audio export.
LLM Script Review (New)
- One-click review pass — "Review Script" button in the Script tab runs a second LLM pass over the generated script to detect and fix common annotation errors
- 5 automated fix categories:
- Attribution tags stripped from dialogue ("said he", "she replied")
- Narration mixed into character entries split out as NARRATOR
- Dialogue embedded in narrator entries extracted as the correct speaker
- Short consecutive narrator entries merged for consistent TTS delivery
- Invalid instruct fields (physical actions) replaced with voice directions
- Text-loss safety net — Programmatic validation rejects any batch where significant text was dropped, falling back to the original entries
- Customizable prompts — Review prompts stored in
review_prompts.txt(same separator format as generation prompts), hot-reloaded on every request - Batch processing with context — Processes script in batches of ~25 entries, passing tail context between batches for accurate speaker attribution at boundaries
Bug Fixes
- Fix CPU model loading crash —
device_map="cpu"triggered HuggingFace accelerate's meta tensor dispatch, causing "Cannot copy out of meta tensor; no data!" errors. Now omitsdevice_mapon CPU. (Fixes #4) - Fix parallel generation race condition — Multiple TTS worker threads were overwriting each other's status updates to
chunks.json, causing the UI to show random Error/Pending states despite all chunks succeeding. New atomic_update_chunk_fields()method ensures thread-safe read-modify-write. (Fixes #3) - Fix silent MP3 encoding failure — Conda's Windows ffmpeg often lacks libmp3lame, causing
pydub.export()to silently produce a 428-byte header-only MP3 file. Now validates exported file size and automatically falls back to WAV when MP3 encoding fails. (Fixes #3)
Prompt Architecture
- Single source of truth — All default prompts consolidated into
default_prompts.txt(generation) andreview_prompts.txt(review) at project root - Hot-reloadable — Edit prompt files and changes take effect immediately, no app restart needed
- Improved generation prompts — Refined narrator/character split rules and instruct directions based on iterative testing