Skip to content

Commit d334fb7

Browse files
committed
fixed a bug incurred by passing in very long reference audio
1 parent eb92b1e commit d334fb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/v2/vc_wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(
4949
self.compiled_decode_fn = None
5050
self.dit_compiled = False
5151
self.dit_max_context_len = 30 # in seconds
52+
self.ar_max_content_len = 1500 # in num of narrow tokens
5253
self.compile_len = 87 * self.dit_max_context_len
5354

5455
def forward_cfm(self, content_indices_wide, content_lens, mels, mel_lens, style_vectors):
@@ -575,7 +576,7 @@ def convert_voice_with_streaming(
575576
src_narrow_reduced, src_narrow_len = self.duration_reduction_func(source_narrow_indices[0], 1)
576577
tgt_narrow_reduced, tgt_narrow_len = self.duration_reduction_func(target_narrow_indices[0], 1)
577578
# Process src_narrow_reduced in chunks of max 1000 tokens
578-
max_chunk_size = 1000
579+
max_chunk_size = self.ar_max_content_len - tgt_narrow_len
579580

580581
# Process src_narrow_reduced in chunks
581582
for i in range(0, len(src_narrow_reduced), max_chunk_size):

0 commit comments

Comments
 (0)