Spaces:
Paused
Paused
Commit History
-
feat: bounded pre-gen, cancellation, disk cache pruning, GPU lock
- tts.py: limit pre-gen to first 3 chunks (configurable via env vars), cancel_pregeneration() for Ask/book-switch, LRU eviction of story cache, disk cache pruning (max 400 files / 512MB), GPU_INFERENCE_LOCK integration - app.py: cancel pregen on Ask and book select, show target/error status - inference_lfm.py: GPU lock around generate, improved error handling - qa_flow.py: release_audio_submission for retry on error - test_modules/test_tts_pregen.py: new test for pregen flow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>994d3d9 -
refactor: runtime config, Q&A flow module, storage paths, and cleanup
- runtime_config.py: centralized storage paths (supports HF persistent storage) - qa_flow.py: testable Q&A logic with dedup (claim_audio_submission) - tts.py: pregeneration progress tracking (get_pregeneration_status) - app.py: use runtime_config paths, show pregen status on book select, remove flash-attn runtime install, fix profile stories count - README.md: updated for LFM Q&A architecture - .gitignore: add audio_cache/ - requirements.txt: updated deps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>397b4ac -
feat: persist voice profiles to Voice_Profile/ with auto-load on startup
Voice profile persistence: - Profiles saved to Voice_Profile/<id>/profile.pt + metadata.json on clone - On app startup, most recent profile auto-loaded as default voice - voice_profile_state initialized with saved profile (or None for stock) - synthesize_cloned() falls back to disk if not in memory cache - has_profile() checks both memory cache and disk - create_voice_profile() now accepts voice_name param for metadata - Player shows actual cloned voice name (from metadata) instead of generic label New APIs in voice_clone.py: - save_profile_to_disk(profile_id, voice_name) -> Path - load_profile_from_disk(profile_id) -> bool - list_saved_profiles() -> list[dict] - load_default_profile() -> str | None Voice_Profile/ added to .gitignore (user data). 102 tests pass (28 latency/persistence + 74 integration). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>0d420e4 -
test: add comprehensive integration test suite (74 tests)
Covers module imports, story loading, chunk splitting, HTML rendering, XSS escaping, Gradio wiring, handler signatures, voice profile integration, state machine consistency, app launch readiness, and file structure validation. All 92 tests pass (18 latency + 74 integration). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>122c643 -
perf: add TTS latency optimizations
Optimizations applied to voice_clone.py and tts.py: - Auto-select bfloat16 (Ampere+) or float16 per GPU architecture - FlashAttention-2 when available, SDPA fallback - Streaming mode (non_streaming_mode=False) - Reduced sampling: top_k=20, temperature=0.7, max_new_tokens=1024 - torch.set_float32_matmul_precision('high') - torch.compile on decoder/predictor submodules (best-effort) - Reference audio trimmed to 10s max for faster embedding extraction - 0.6B CustomVoice model as fast non-cloned fallback (env: QWEN_TTS_MODE) - Added librosa to requirements.txt - FlashAttention-2 install instructions in requirements.txt - 18-test suite for all optimization configs (test_latency_optimizations.py) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>d3a755c -
feat: implement real voice cloning with Qwen3-TTS (sprint step 3)
- Add voice_clone.py: Qwen3-TTS model wrapper with server-side profile cache, create_voice_profile() and synthesize_cloned() API - Refactor tts.py: backend-neutral interface delegates to Qwen3-TTS when voice_profile_id provided, Supertonic fallback otherwise - Wire app.py: real cloning in animate_cloning_pipeline, voice profile flows via gr.State to narration (stream_tts) and Q&A - Fix XSS: html.escape in render_story_text and clone success card - Fix misleading fallback: hide audio widget when TTS fails instead of playing fake chime audio - Add qwen-tts to requirements.txt - Update copilot-instructions.md with new architecture Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>215fff0 -
feat: wire Whisper-small ASR and Qwen2.5-3B Q&A into app (sprint steps 9-10)
- Add inference.py: on-demand Whisper-small transcription + Qwen2.5-3B-Instruct grounded story Q&A with context retrieval - Update app.py handle_question_submit to use real ASR + Q&A + TTS pipeline - Add test_modules/test_whisper_qwen.py for model verification - Add .github/copilot-instructions.md for Copilot context - Update sprint.md: mark steps 9 and 10 complete - Add sample_sounds/ to .gitignore (generated at runtime) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>e99dd36
-
feat: integrate Supertonic TTS with sentence-level chunk streaming
- Add tts.py: lazy singleton TTS loader, sentence-level text splitter, and background-threaded generator that synthesizes chunks into a bounded queue and yields (sample_rate, wav, idx, total, err) per chunk - Update app.py: add tts_chunks_state; on book select, split full story text into TTS sentence chunks stored in state - Switch player_audio_control to streaming=True / type=numpy / autoplay=True - Replace play_btn handler with stream_tts generator that synthesizes and streams audio chunks one by one with live chunk progress in the status bar - Add test_modules: supertonic demo, clone demo, and TTS module spec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> chore: add .gitattributes for Git LFS binary tracking Track *.png, *.jpg, *.jpeg, *.wav, *.mp3, *.gif, *.webp via Git LFS so HuggingFace Space accepts the push. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>5f8f265