fix(tts): use Hugging Face cache for speaker encoder - #15986
Open
janbernloehr wants to merge 1 commit into
Open
Conversation
Signed-off-by: jbernloehr <jbernloehr@nvidia.com>
Member
|
Hi @janbernloehr , Thank you very much for the PR. The proposed change makes sense, and I think we should work toward getting it merged. It should also allow us to remove the fsspec dependency entirely. I will add the Edresson/Speaker_Encoder_H_ASP model to the Hugging Face cache in our test environment so that the CI tests can pass. Would you be willing to also remove the remaining fsspec references from the following files? nemo/collections/tts/modules/audio_codec_modules.py Otherwise, I am happy to make those changes and push a commit directly to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Resolve the pretrained speaker-encoder checkpoint through
hf_hub_downloadbefore loading it. This allows
AudioCodecModelto use Hugging Face caching,authentication, offline-mode, and retry behavior instead of fetching a
hardcoded URL on every model construction.
Collection: TTS
Changelog
Edresson/Speaker_Encoder_H_ASPthroughhf_hub_download.strict=Falsebehavior.
path are used.
Usage
No public API or configuration changes.
Before your PR is "Ready for review"
Pre checks:
huggingface_hubis an existing dependency.PR Type:
Testing
pytest tests/collections/tts/models/test_audio_codec.py -m "not pleasefixme" -v— 5 passed
Additional Information
Fixes #15985
Question for maintainers: offline CI behavior
The Magpie functional tests run with
HF_HUB_OFFLINE=1and use a pre-populated Hugging Face cache. The newhf_hub_download()call correctly consults that cache, butEdresson/Speaker_Encoder_H_ASP/pytorch_model.binis not currently present.The failure occurs when
FrechetCodecDistancerestores the codec withuse_scl_loss=True, although FCD only uses the codec embeddings and does not use the speaker encoder. The regular Magpie inference loader already overridesuse_scl_loss=False.Which approach would you prefer?
use_scl_losswhen FCD restores the codec, matching the existing inference path.Option 2 appears to be the smallest behavioral change; cache provisioning may still be appropriate for CI that intentionally exercises speaker-consistency loss.