Fixes floating point gpt conditioning lenghts.

This commit is contained in:
Sinan 2024-08-14 05:19:04 +02:00 committed by GitHub
parent dbf1a08a0d
commit 059719a89a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -271,8 +271,8 @@ class Xtts(BaseTTS):
audio = audio[:, : 22050 * length]
if self.args.gpt_use_perceiver_resampler:
style_embs = []
for i in range(0, audio.shape[1], 22050 * chunk_length):
audio_chunk = audio[:, i : i + 22050 * chunk_length]
for i in range(0, audio.shape[1], int(22050 * chunk_length)):
audio_chunk = audio[:, i : i + int(22050 * chunk_length)]
# if the chunk is too short ignore it
if audio_chunk.size(-1) < 22050 * 0.33: