Skip to content

Kokoro docs updates#4381

Open
michalkulakowski wants to merge 2 commits into
mainfrom
mkulakow/kokoro_docs
Open

Kokoro docs updates#4381
michalkulakowski wants to merge 2 commits into
mainfrom
mkulakow/kokoro_docs

Conversation

@michalkulakowski

Copy link
Copy Markdown
Collaborator

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

Copilot AI review requested due to automatic review settings July 17, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --voice support to the benchmark client for text2speech requests 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.md to 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}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add?

Comment thread demos/benchmark/v3/benchmark.py
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")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add?

Comment thread demos/benchmark/v3/benchmark.py
Comment thread demos/audio/README.md
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove.

@rasapala rasapala left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot had some good suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants