Skip to content

[StyleTTS2] load pretrained checkpoint from HuggingFace#807

Open
roedoejet wants to merge 6 commits into
dev.ap/styletts2-improvementsfrom
dev.ap/stts2-hf-checkpoints
Open

[StyleTTS2] load pretrained checkpoint from HuggingFace#807
roedoejet wants to merge 6 commits into
dev.ap/styletts2-improvementsfrom
dev.ap/stts2-hf-checkpoints

Conversation

@roedoejet
Copy link
Copy Markdown
Member

PR Goal?

Loading pretrained models from within the codebase is messy since we need to handle the paths, and the model checkpoints bloat the package/our git history.

Fixes?

An element of #686

Feedback sought?

Does this look reasonable? I think the "local override" option is still not going to be handled well since it will put a potentially absolute path in the config.

Priority?

high

Tests added?

None

How to test?

if you train a model with this branch, you should see the HF models downloading automatically

Confidence?

medium

Version change?

n/a

Related PRs?

EveryVoiceTTS/StyleTTS2#6

Once accepted, we'll need to clean the git history of any *.t7 or *.pth files

@roedoejet roedoejet requested a review from joanise May 19, 2026 23:34
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented May 19, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  everyvoice/tests/data/relative/config/everyvoice-text-to-wav.yaml  33% smaller
  everyvoice/cli.py  15% smaller
  everyvoice/.schema/everyvoice-text-to-wav-0.5.json  4% smaller
  everyvoice/model/e2e/StyleTTS2_lightning  0% smaller
  everyvoice/wizard/basic.py  0% smaller

@roedoejet roedoejet mentioned this pull request May 19, 2026
25 tasks
@roedoejet roedoejet force-pushed the dev.ap/stts2-hf-checkpoints branch from 83961c7 to e02782e Compare May 20, 2026 00:17
@roedoejet roedoejet changed the title chore: update submodule [StyleTTS2] load pretrained checkpoint from HuggingFace May 20, 2026
@roedoejet roedoejet marked this pull request as draft May 20, 2026 05:11
@joanise
Copy link
Copy Markdown
Member

joanise commented May 20, 2026

the new-project wizard still expected the pre-trained files to exist

@joanise
Copy link
Copy Markdown
Member

joanise commented May 20, 2026

The concept is good here.

For the local override, we could put a warning in the field's documentation that it gets saved in the models. Also, we could support $HOME/path/to/... fairly easily with os.path.expandvars() and os.path.expanduser() which could get called after pydantic validation, or maybe in post-validation, as long as the input string is what gets saved in the config.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

CLI load time: 0:00.29
Pull Request HEAD: 149600faf4eeae8730bf13a3cdb68732bd3f2199

Imports that take more than 0.1 s:
import time: self [us] | cumulative | imported package
import time:       974 |     108906 |   typer
import time:      6022 |     107542 |               loguru._logger
import time:      3714 |     112498 |             loguru
import time:      2775 |     162048 |           everyvoice.utils
import time:       903 |     162950 |         everyvoice.model.feature_prediction.FastSpeech2_lightning.fs2.cli.benchmark
import time:       525 |     171552 |       everyvoice.model.feature_prediction.FastSpeech2_lightning.fs2.cli.cli
import time:       316 |     171868 |     everyvoice.model.feature_prediction.FastSpeech2_lightning.fs2.cli
import time:      1333 |     173200 |   everyvoice.model.feature_prediction.FastSpeech2_lightning.fs2.cli.check_data
import time:      8242 |     388353 | everyvoice.cli
import time:      2183 |     119259 |       markdown_it.main
import time:       379 |     119637 |     markdown_it
import time:      5246 |     177500 |   rich.markdown
import time:      4248 |     267395 | typer.rich_utils

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.99%. Comparing base (c1875dd) to head (8b813f5).
⚠️ Report is 1 commits behind head on dev.ap/styletts2-improvements.

Additional details and impacted files
@@                      Coverage Diff                       @@
##           dev.ap/styletts2-improvements     #807   +/-   ##
==============================================================
  Coverage                          84.98%   84.99%           
==============================================================
  Files                                 46       46           
  Lines                               4217     4219    +2     
  Branches                             632      632           
==============================================================
+ Hits                                3584     3586    +2     
  Misses                               494      494           
  Partials                             139      139           

☔ View full report in Codecov by Sentry.
📢 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.

@roedoejet roedoejet force-pushed the dev.ap/stts2-hf-checkpoints branch from 0610813 to 8a744b3 Compare May 20, 2026 22:40
@roedoejet
Copy link
Copy Markdown
Member Author

The concept is good here.

For the local override, we could put a warning in the field's documentation that it gets saved in the models. Also, we could support $HOME/path/to/... fairly easily with os.path.expandvars() and os.path.expanduser() which could get called after pydantic validation, or maybe in post-validation, as long as the input string is what gets saved in the config.

good idea. I've added this.

@roedoejet roedoejet marked this pull request as ready for review May 20, 2026 23:04
@roedoejet roedoejet force-pushed the dev.ap/styletts2-improvements branch 4 times, most recently from a5b2a20 to e8c84a4 Compare May 21, 2026 20:56
@roedoejet roedoejet force-pushed the dev.ap/stts2-hf-checkpoints branch 4 times, most recently from 0aa45f4 to d9de20b Compare May 22, 2026 01:06
@roedoejet roedoejet force-pushed the dev.ap/styletts2-improvements branch from 1ac2571 to cca19c5 Compare May 27, 2026 23:52
@roedoejet roedoejet force-pushed the dev.ap/stts2-hf-checkpoints branch from 8b813f5 to 149600f Compare May 27, 2026 23:54
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