Skip to content

Comments

feat: add text input mode and fix TTS thread synchronization#1

Open
aopstudio wants to merge 1 commit intotc-mb:masterfrom
aopstudio:feature/text-input-mode
Open

feat: add text input mode and fix TTS thread synchronization#1
aopstudio wants to merge 1 commit intotc-mb:masterfrom
aopstudio:feature/text-input-mode

Conversation

@aopstudio
Copy link

Summary

  • Add --text parameter for direct text input testing without requiring audio input
  • Add eval_text_string helper function and test_case_text for text input mode
  • Fix TTS/T2W thread synchronization issue: properly wait for threads to finish processing before sending stop signals
  • Update README.md with --text option documentation and usage example

Changes

New Feature: Text Input Mode

Users can now test the model with text input directly, without needing to prepare audio files:

./build/bin/llama-omni-cli \
    -m /path/to/MiniCPM-o-4_5-gguf/MiniCPM-o-4_5-Q4_K_M.gguf \
    --text "Hello, please introduce yourself"

Bug Fix: TTS Thread Synchronization

Previously, omni_stop_threads was called immediately after test_case returned, which caused the TTS/T2W threads to be stopped before they finished processing. This resulted in incomplete or missing WAV output files.

The fix adds proper wait logic:

  1. Wait for speek_done flag to indicate TTS completion
  2. Wait for T2W queue to be empty before stopping threads
  3. Add small delay for T2W to finish final processing

Test Plan

  • Test text input mode with Chinese text: --text "请介绍一下Python语言"
  • Verify WAV files are generated in tools/omni/output/round_000/tts_wav/
  • Verify all threads terminate cleanly without hanging

🤖 Generated with Claude Code

- Add --text parameter for direct text input testing without audio
- Add eval_text_string helper function and test_case_text for text mode
- Fix TTS/T2W thread synchronization: wait for threads to finish before stopping
- Update README.md with --text option documentation and usage example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant