Kokoro docs updates#4381
Open
michalkulakowski wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the audio demo documentation to use Kokoro as the primary speech-generation example and extends the v3 benchmark client to support text-to-speech voice selection and report audio-centric metrics (duration/RTFx).
Changes:
- Add
--voicesupport to the benchmark client fortext2speechrequests and compute audio duration from WAV responses. - Add text-to-speech benchmarking summary that reports success rate, latency stats, and RTFx.
- Refresh
demos/audio/README.mdto document Kokoro-based speech generation and align model naming/examples for Whisper usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
demos/benchmark/v3/benchmark.py |
Adds voice parameter support for TTS, computes audio duration from WAV output, and prints RTFx/summary metrics. |
demos/audio/README.md |
Switches the speech-generation walkthrough to Kokoro, updates example commands, and adds RTFx benchmarking note. |
Comment on lines
+150
to
+154
| try: | ||
| output.audio_duration = soundfile.info(io.BytesIO(audio_bytes)).duration | ||
| except Exception as e: | ||
| output.success = False | ||
| output.error = f"Could not decode WAV response to compute audio duration: {e}" |
Comment on lines
+467
to
+471
| print("Tokens:",num_tokens) | ||
| print(f"Success rate: {success_rate}%. ({success_count}/{total_count})") | ||
| print(f"Throughput - Tokens per second: {num_tokens / benchmark_results['duration']:^,.1f}") | ||
| print(f"Mean latency: {np.mean(benchmark_results['latencies'])*1000:.2f} ms") | ||
| print(f"Median latency: {np.median(benchmark_results['latencies'])*1000:.2f} ms") |
Comment on lines
+101
to
+103
| > **Note:** `RTFx` (Real-Time Factor, inverted) is calculated as `generated_audio_duration / generation_time`. | ||
| > Values greater than `1.0x` mean faster-than-real-time generation, while values below `1.0x` mean slower-than-real-time. | ||
|
|
michalkulakowski
force-pushed
the
mkulakow/kokoro_docs
branch
from
July 17, 2026 13:51
7b00a65 to
f67ad54
Compare
rasapala
reviewed
Jul 17, 2026
rasapala
left a comment
Collaborator
There was a problem hiding this comment.
Copilot had some good suggestions.
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.
🛠 Summary
JIRA/Issue if applicable.
Describe the changes.
🧪 Checklist
``