1
1
forked from mrq/tortoise-tts

updates chunk size to the chunked tensor length, just in case

This commit is contained in:
mrq 2023-02-14 17:13:34 +00:00
parent 48275899e8
commit 0bc2c1f540

View File

@ -364,6 +364,7 @@ class TextToSpeech:
print(f"Using method 1: size of best fit: {chunk_size}") print(f"Using method 1: size of best fit: {chunk_size}")
chunks = torch.chunk(concat, int(concat.shape[-1] / chunk_size), dim=1) chunks = torch.chunk(concat, int(concat.shape[-1] / chunk_size), dim=1)
chunk_size = chunks[0].shape[-1]
# old new behavior: # old new behavior:
# if chunkning tensors: use the smallest voice sample as a common size of best fit # if chunkning tensors: use the smallest voice sample as a common size of best fit
@ -388,6 +389,7 @@ class TextToSpeech:
chunks.append(s) chunks.append(s)
else: else:
chunks = samples chunks = samples
chunk_size = chunks[0].shape[-1]
# expand / truncate samples to match the common size # expand / truncate samples to match the common size
# required, as tensors need to be of the same length # required, as tensors need to be of the same length