Skip to content

feat(breath): support BreathLab v6 model with optional EP annotation - #5

Closed
Xiantaidu wants to merge 1 commit into
KakaruHayate:mainfrom
Xiantaidu:test
Closed

Xiantaidu wants to merge 1 commit into
KakaruHayate:mainfrom
Xiantaidu:test

Conversation

@Xiantaidu

Copy link
Copy Markdown
Contributor

Summary

This PR introduces support for the BreathLab v6 model, which adds an EP (exhale) detection head alongside the existing AP (audible breath) and SP (silence/pause) heads.

EP annotation is implemented as an opt-in feature (via the --ep CLI flag and a dedicated UI checkbox toggle), maintaining full backward compatibility with BreathLab v5 models and existing workflows.

The BreathLab v6 ONNX checkpoint and metadata files can be obtained here:
👉 https://github.com/Xiantaidu/BreathLab/releases/tag/v1.0.0


Changes

  1. GGUF Conversion (scripts/convert_breath_to_gguf.py):

    • Export breath.postprocess.ep_threshold to GGUF post-processing metadata.
    • Make --name optional with automatic detection when --model-dir contains a single .onnx file (or model.onnx).
  2. Inference Engine (src/breath/):

    • Parse breath.head.ep and breath.postprocess.ep_threshold from GGUF.
    • Add optional EP extraction to BreathModel::run and BreathModel::probabilities.
    • Map EP intervals to segment class 3 ("EP") when requested.
    • Safe fallback when loading models without an EP head (such as BreathLab v5).
  3. Phone Merger & CLI (src/cli/):

    • Add "EP" to recognized breath labels in merge_breath_into_phones and is_breath_label.
    • Add --ep option to tifa_ggml_cli breathe:
      • Emits an "EP" tier in TextGrid output.
      • Includes "ep" list in JSON diagnosis.
      • Merges EP segments into the phones tier when --merge is specified.
  4. UI (ui/):

    • Added an EP annotation checkbox toggle under the Breath settings panel.
    • Persists state in user preferences and appends --ep to CLI invocation when checked.
  5. Tests:

    • Added unit test BreatheMerge.InsertsExhaleSegmentsWhenPresent in tests/test_breathe_merge.cpp.
    • All 37 UI smoke tests pass cleanly.

Verification

  • Converted v6_ep_onnx to GGUF (FP16 & FP32) with convert_breath_to_gguf.py.
  • Verified backward compatibility with v5 models (identical output when --ep is omitted).
  • Tested CLI with and without --ep.
  • Verified UI checkbox state persistence and argument passing.

- convert_breath_to_gguf.py: export ep_threshold to GGUF metadata and auto-detect model name for single ONNX models
- breath: load head.ep and ep_threshold, extract EP segments when requested while preserving v5 compatibility
- phone_input: allow folding EP segments into phone tier
- cli: add --ep option to breathe subcommand for EP tier and diagnosis
- tests: add test for EP segment insertion
- ui: add optional checkbox toggle for EP annotation in the Breath panel
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cb0d5656-52b7-461f-872c-8b0abb41b4f7
📥 Commits

Reviewing files that changed from the base of the PR and between 6006fcf and 40b0a2f.

📒 Files selected for processing (8)
  • scripts/convert_breath_to_gguf.py
  • src/breath/breath.cpp
  • src/breath/breath.h
  • src/cli/main.cpp
  • src/cli/phone_input.cpp
  • tests/test_breathe_merge.cpp
  • ui/src/renderer/app.js
  • ui/src/renderer/index.html
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ghfind-review ghfind-review Bot added the review: medium ghfind author score; see https://ghfind.com label Oct 4, 2026
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Autopilot could not be updated. Open Coding to check access and billing.

@KakaruHayate

Copy link
Copy Markdown
Owner
image emmmmmm有点菜?

@Xiantaidu

Copy link
Copy Markdown
Contributor Author

image emmmmmm有点菜?

按说不应该,v6就是在v5上续训加了EP而已,而且我这边的test集测的AP似乎没有明显劣化,我这边再测一次看看

@Xiantaidu

Copy link
Copy Markdown
Contributor Author

image emmmmmm有点菜?

image 在我这边测出的结果似乎并没有那么严重的劣化,你要不复测一下?或者也许是数据集的问题...?但是v6的数据集只增未减,按说也不应该

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

Labels

review: medium ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants