From 0bc2c1f540882186ef5b199f709c7b5aced0452f Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 14 Feb 2023 17:13:34 +0000 Subject: [PATCH] updates chunk size to the chunked tensor length, just in case --- tortoise/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tortoise/api.py b/tortoise/api.py index 9e46597..2ddfd35 100755 --- a/tortoise/api.py +++ b/tortoise/api.py @@ -364,6 +364,7 @@ class TextToSpeech: print(f"Using method 1: size of best fit: {chunk_size}") chunks = torch.chunk(concat, int(concat.shape[-1] / chunk_size), dim=1) + chunk_size = chunks[0].shape[-1] # old new behavior: # if chunkning tensors: use the smallest voice sample as a common size of best fit @@ -388,6 +389,7 @@ class TextToSpeech: chunks.append(s) else: chunks = samples + chunk_size = chunks[0].shape[-1] # expand / truncate samples to match the common size # required, as tensors need to be of the same length