Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update XTTS cloning #3207

Merged
merged 3 commits into from
Nov 13, 2023
Merged

Update XTTS cloning #3207

merged 3 commits into from
Nov 13, 2023

Conversation

erogol
Copy link
Member

@erogol erogol commented Nov 13, 2023

Optionally chunk input audio and average the computed latents. It prevents long silences, especially against references with many silent segments.

@@ -255,39 +255,57 @@ def device(self):
return next(self.parameters()).device

@torch.inference_mode()
def get_gpt_cond_latents(self, audio, sr, length: int = 3):
def get_gpt_cond_latents(self, audio, sr, length: int = 30, chunk_length: int = 6):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the default value here and in the config should be the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

why?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it will be better, users can try to call this function individually and then get very different results. I think the better is both be equal to avoid issues like it.

Copy link
Member Author

Choose a reason for hiding this comment

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

config as in the code or the release model's config

@Edresson
Copy link
Contributor

All looks good to me.

@WeberJulian
Copy link
Contributor

audio = audio.mean(0, keepdim=True)

This can be removed since it's done in load_audio

# load the audio in 24khz to avoid issued with multiple sr references

Comment should say 22khz

apart from that LGTM

@erogol erogol merged commit f32a465 into dev Nov 13, 2023
53 checks passed
@ukemamaster
Copy link

@erogol With this PR we will be able to use upto 30s of speaker_wav for voice cloning? Instead of 6s (before)?

@erogol
Copy link
Member Author

erogol commented Nov 16, 2023

You can use any length and any number of samples. Just don't go wild. Samples should be consistent in style, pitch, etc.

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.

4 participants