Skip to content

Support phone-based model inference for StyleTTS2 - #868

Merged
roedoejet merged 7 commits into
mainfrom
dev.ap/phone-based-models
Aug 28, 2026
Merged

Support phone-based model inference for StyleTTS2#868
roedoejet merged 7 commits into
mainfrom
dev.ap/phone-based-models

Conversation

@roedoejet

@roedoejet roedoejet commented Aug 28, 2026

Copy link
Copy Markdown
Member

PR Goal?

When I tested the demo, I only tested it with character based models, but this was only less than half of the issue. For inference with phone-based models we needed to follow the FS2 implementation which is:

  • even for monolingual models, a lang2id needs to be defined on the model
  • that lang code informs the text processing which, if passed characters, will look in g2p_engines for a g2p engine with the same lang code before inference
  • I added this, and also added the chunking while I was at it
  • lastly, I added a toggle in the demo to say whether the input text is phones or characters since we might want to input either in the demo.
  • I added some debugging comments to address this going forward so we can see in the logs how g2p is processing the text into tokens.

Development was assisted with Claude Code Sonnet 5, reviewed by me.

Feedback sought?

code review/sanity - is there anything else I'm forgetting here wrt things that are needed for inference?

Priority?

before 0.5.0. :)

Confidence?

medium-high (tested with my pre-trained checkpoints)

Version change?

Related PRs?

EveryVoiceTTS/StyleTTS2#27

@semanticdiff-com

semanticdiff-com Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  everyvoice/demo/app.py  32% smaller
  everyvoice/tests/test_utils.py  8% smaller
  everyvoice/cli.py  0% smaller
  everyvoice/config/type_definitions.py  0% smaller
  everyvoice/model/e2e/StyleTTS2_lightning  0% smaller
  everyvoice/model/feature_prediction/FastSpeech2_lightning  0% smaller
  everyvoice/model/vocoder/HiFiGAN_iSTFT_lightning  0% smaller
  everyvoice/tests/test_demo.py  0% smaller
  everyvoice/tests/test_text.py  0% smaller
  everyvoice/text/textsplit.py  0% smaller
  everyvoice/utils/__init__.py  0% smaller

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.77528% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.44%. Comparing base (70c7e16) to head (aadab4d).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
everyvoice/demo/app.py 72.97% 10 Missing ⚠️
everyvoice/cli.py 64.70% 3 Missing and 3 partials ⚠️
everyvoice/text/textsplit.py 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #868      +/-   ##
==========================================
+ Coverage   85.22%   85.44%   +0.22%     
==========================================
  Files          51       51              
  Lines        4710     4782      +72     
  Branches      700      710      +10     
==========================================
+ Hits         4014     4086      +72     
+ Misses        535      525      -10     
- Partials      161      171      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor
CLI load time: 0:00.25
Pull Request HEAD: aadab4da70383dec8a6c0fdf4ea38c36949f5e5c

Imports that take more than 0.1 s:
import time: self [us] | cumulative | imported package
import time:       671 |     110408 |   typer
import time:      7344 |     232885 | everyvoice.cli
import time:      5453 |     140074 |   rich.markdown
import time:      4571 |     257230 | typer.rich_utils

@joanise joanise left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Initial comments

Comment thread everyvoice/cli.py Outdated
Comment thread everyvoice/demo/app.py Outdated
@roedoejet
roedoejet requested a review from joanise August 28, 2026 19:46

@joanise joanise left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me (once CI passes).

@roedoejet
roedoejet force-pushed the dev.ap/phone-based-models branch from b7a9fea to aadab4d Compare August 28, 2026 22:41
@roedoejet
roedoejet merged commit 772f830 into main Aug 28, 2026
11 checks passed
@roedoejet
roedoejet deleted the dev.ap/phone-based-models branch August 28, 2026 22:44
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.

2 participants