Skip to content

test(tts): Verify Kokoro TTS implementation (#183) #184

@m96-chan

Description

@m96-chan

Overview

Test verification for PR #185 (fix for Issue #179 - TTS beep sound bug).

Test Items

Unit Tests (Added to PR #185)

  • ALBERTEncoder forward pass produces valid hidden states
  • KokoroTextEncoder forward pass produces valid features
  • WeightNormConv1d computes correct normalized weights
  • InstanceNorm1d normalizes correctly
  • AdaIN applies style conditioning correctly
  • build_albert_from_weights() constructs encoder from weight dict
  • build_text_encoder_from_weights() constructs text encoder from weight dict

Test file: tests/test_tts_layers.py (12 tests)

Integration Tests

  • KokoroModel.from_pretrained() loads model without errors
  • KokoroModel.synthesize() runs without exceptions
  • Output audio has correct sample rate (24kHz)
  • Output audio duration is proportional to input text length
  • No 440Hz beep in output audio

End-to-End Tests

  • Generate audio from "Hello, world!" text
  • Generate audio with different voices (af_heart, etc.)
  • Save audio to WAV file and verify playback
  • Compare output with reference implementation (if available)

Test Environment

  • Model: Kokoro-82M (hexgrad/Kokoro-82M)
  • Voice: af_heart (default)
  • Hardware: GPU with CUDA support

Related

Notes

Full audio generation quality depends on decoder/vocoder implementation which is still in progress. Current tests should verify the text encoding pipeline works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions