Improved output via increased latent variability + allowing high quality subset of voice clips for CVVP #740
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.
Rather than using an averaged set of latents derived from voice clips, I've added the ability to instead:
1.) Generate latents (for autoregression and diffusion)
2.) For each autoregressed sample, use a randomly selected latent rather than the averaged latent
3.) Use CVVP to influence selection of ideal autoregressive output (in addition to CLVP).
Why is this better? Firstly, no changes are required to interface with api.py. All user code should continue to work as expected.
Secondly, these improvements allow us to input many more voice clips, and allow CVVP to determine which voice clip (or rather, latent of the voice clip) is most salient. We also allow explicit insertion of "auto_conds" such that the CVVP portion of the model can operate using only high confidence Mels.
This allows for the following process:
1.) Generate a large number of voice clips (potentially from a Youtube video or multiple videos)
2.) Optionally, cluster latents derived from voice clips
3.) Use either voiceclips, their latents, or their cluster centroids as input latents
4.) Select a high quality subset of voice clips to use as conditional Mels into CVVP.
5.) Run tts setting the new parameter "use_averaged_latents" to False, and passing "auto_conds" and "conditioning_latents" explicitly. - Also set cvvp_amount > 0 (> .7 works well in my experiments)
The overarching idea here is that we allow CVVP to better select outputs generated from a more diverse set of latents. I haven't quantified this, but subjectively, this has allowed for more accurate generation of a wider set of voices.
*important note: Previous link to huggingface CVVP model parameters was not accurate ("Manmay/tortoise-tts"), I've
altered this path to "jbetker/tortoise-tts-v2")
Check out https://soundgif.io for a basic system I've created operating on these changes.
I understand that this may be (too) many changes for a single commit. Please let me know if you have any questions.