Add HuggingFace WavLM backend to speaker similarity metric - #87
Open
NewGamezzz wants to merge 8 commits into
Open
Add HuggingFace WavLM backend to speaker similarity metric#87NewGamezzz wants to merge 8 commits into
NewGamezzz wants to merge 8 commits into
Conversation
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.
Why
Most recent TTS and voice-conversion papers report speaker similarity (SIM) using HuggingFace speaker-verification models, most commonly
microsoft/wavlm-base-sv(or its variants, e.g.,wavlm-base-plus-sv). Since thespeakermetric only supports ESPnet-SPK models, VERSA scores cannot be directly compared against the numbers reported in those papers. This PR adds support for HF x-vector models so that users can reproduce the evaluation setup with the same config format as before:File Changes:
versa/utterance_metrics/speaker.py: addedresolve_speaker_backend(), which auto-detects the backend from model_tag. A thinHFSpeakerModelwrapper mirrorsSpeech2Embedding's call signature so both backends share the existing cosine-similarity code. No new dependencies:transformerswas already in the ml extra and the import is guarded.versa/scorer_shared.py: made the shared cache namespace config-aware so HF speaker models cache underhuggingface/instead ofespnet_model_zoo/.versa/config_validation.py: dependency validation now only requires the selected backend's package, so a transformers-only install can run WavLM configs without being asked to install espnet2 (and vice versa).egs/separate_metrics/spk_similarity_wavlm.yaml(new) anddocs/supported_metrics.md: example config and docs for the new backend.test/test_metrics/test_speaker.pyandtest/test_pipeline/test_speaker_wavlm.py(new): unit tests for backend resolution, caching, and validation.