From 059719a89aa0637b20e5ff25bba067c747079ba8 Mon Sep 17 00:00:00 2001 From: Sinan Date: Wed, 14 Aug 2024 05:19:04 +0200 Subject: [PATCH] Fixes floating point gpt conditioning lenghts. --- TTS/tts/models/xtts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TTS/tts/models/xtts.py b/TTS/tts/models/xtts.py index 8e9d6bd382..2a8fd9e16b 100644 --- a/TTS/tts/models/xtts.py +++ b/TTS/tts/models/xtts.py @@ -271,8 +271,8 @@ def get_gpt_cond_latents(self, audio, sr, length: int = 30, chunk_length: int = 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: