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: