Feature/streaming redevelop from main - #32
Open
NemesisGuy wants to merge 3 commits into
Open
Conversation
… queueing, playback and timings; docs and tooling
…ate --timings reports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(streaming): add sentence-level streaming CLI with REPL, prompt cache, playback, and timings
🧩 Summary
This pull request introduces a sentence-level streaming inference CLI for SoulX Podcast with both one-shot and interactive REPL modes.
It also adds persistent prompt-feature caching, timing utilities, and a non-blocking compute → playback pipeline for smoother and faster generation.
Key Features
--replmodes.--text,--speaker,--reference_wav,--play,--precache_prompts,--clear_cache, and--timingsflags..prompt_cache/for reuse across runs.mtimevalidation to auto-refresh if source WAV changes.timing.pywithTimerandTIMING_COLLECTOR.--timingsto log per-stage durations (feature extraction, spk-embed, flow-mel, synthesis, playback).README.mdwith streaming usage examples.CHANGELOG.mdand development helper for syntax validation.🗂️ Files Changed (High-Level)
cli/streaming.pysoulxpodcast/utils/prompt_cache.pysoulxpodcast/utils/timing.pyTimercontext and collector.soulxpodcast/utils/dataloader.pyreadme.mdCHANGELOG.mdtools/py_compile_all.py.pyfiles.requirements.txtsounddevice,simpleaudio) now included as default dependencies.🎯 Motivation
This upgrade reduces perceived latency, improves GPU utilization, and enhances user experience for interactive and demo scenarios.
🧪 Testing & Validation Checklist
1. Syntax Check
2. Environment Setup
3. One-Shot Inference Test
✅ Expect: audio playback or generated WAV output.
4. REPL Interactive Test
✅ Type multiple sentences. Observe queued confirmations and playback while typing the next input.
5. Timing Test
✅ Expect: timing breakdown per stage (
feature_load,spk_embed,flow_mel, etc).6. Cache Verification
✅ Second run logs:
[cache hit] using precomputed prompt features...✅ Observe reduced runtime for repeated prompt features.
⚙️ Notes / Known Limitations
mtime. Future improvement: add SHA1 hashing for content-based validation.sounddevice,simpleaudio) are installed by default.torch,torchaudio,onnxruntime) may trigger IDE warnings but are correct for runtime usage.🏷️ Labels & Milestone
✅ Benchmark / Performance Note
Prompt-feature caching reduces repeated feature extraction and shortens cold-to-warm turnaround time.
Exact timings depend heavily on hardware, GPU/CPU configuration, and whether the model is already loaded.
Reproducible Benchmark Instructions
Run a cold input (no cache) — observe
TIMING_COLLECTORoutput.Run the same input again (warm) — observe cache hits and reduced
feature_loadduration.Compare fields (ignore
total:summation):feature_load(cold vs warm)model_forward(neural inference time)total_run(end-to-end after model load)Status: Ready for Review 🚀
Author: @NemesisGuy
Date: November 2025
Feature: Streaming CLI + Persistent Prompt Cache + REPL Playback