Skip to content

Default to the release tag only for the released repository - #13

Merged
IgorSwat merged 3 commits into
mainfrom
fix/default-revision
Nov 24, 2026
Merged

IgorSwat merged 3 commits into
mainfrom
fix/default-revision

Conversation

@benITo47

Copy link
Copy Markdown
Collaborator

TTS.from_pretrained pins revision="v1.0.0" for every repository, so a fine-tune without a v1.0.0 tag fails to load. That includes the Hub's "Use this model" snippet, which huggingface/huggingface.js#2928 shows on every model tagged reverb-tts. The maintainer pointed this out in their review.

Changes

  • revision defaults to None. For software-mansion/Reverb-TTS it still resolves to v1.0.0. Any other repository loads its latest commit, the same way the codec revision already works.
  • A revision you pass is used as given, for any repository.
  • Preset voices don't change: they always come from software-mansion/Reverb-TTS.

This merges cleanly with #11.

Testing

  • pytest: 54 passed, including a new test for the four cases: the released repository and another repository, each with and without a revision.
  • On main, the new test fails for another repository without a revision, the case from the review, and passes with this change.

🤖 Generated with Claude Code

from_pretrained pinned revision="v1.0.0" for every repository, so a
fine-tune without that tag failed to load, including through the Hub's
"Use this model" snippet. The tag is now the default for
software-mansion/Reverb-TTS only; other repositories load their latest
commit unless you pass a revision.
Comment thread reverb_tts/tts.py Outdated
- dtype: by default bfloat16 on CUDA (float16 without bf16 support), float16 on MPS and float32 on the CPU.
"""

revision = revision or (REVISION if str(name_or_path) == REPOSITORY else None)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

By sillicon friend:

The name match is case-sensitive. The new line is str(name_or_path) == REPOSITORY. 
Hugging Face repo names are case-insensitive, so TTS.from_pretrained("software-mansion/reverb-tts") loads the official weights but from the latest commit instead of v1.0.0. 
Today that gives the same weights, because the commits after the tag only touch the README and add a root config.json. It would quietly stop being pinned once main gets new weights. 
A one-word fix is to compare str(name_or_path).lower() == REPOSITORY.lower().

Is this the intended effect, that we want to load from main and not v1.0.0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, not intended. Only fine-tunes should load main. Any spelling of software-mansion/Reverb-TTS should stay on v1.0.0. The Hub does resolve software-mansion/reverb-tts to our repo (checked), so I've made the comparison case-insensitive and added that case to the test.

The Hub resolves repository names in any case, so software-mansion/reverb-tts is the released repository too and stays on v1.0.0.
@IgorSwat
IgorSwat merged commit 2c72a7f into main Nov 24, 2026
2 checks passed
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