Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -361,7 +361,7 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
|
|
361 |
audio, sr = torchaudio.load(ref_audio)
|
362 |
|
363 |
# Use the new chunk_text function to split gen_text
|
364 |
-
max_chars = int(0.
|
365 |
print(f"max chars: {max_chars} ")
|
366 |
gen_text_batches = chunk_text(gen_text, max_chars=max_chars)
|
367 |
print('ref_text', ref_text)
|
|
|
361 |
audio, sr = torchaudio.load(ref_audio)
|
362 |
|
363 |
# Use the new chunk_text function to split gen_text
|
364 |
+
max_chars = int(0.2 * (len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (25 - audio.shape[-1] / sr)))
|
365 |
print(f"max chars: {max_chars} ")
|
366 |
gen_text_batches = chunk_text(gen_text, max_chars=max_chars)
|
367 |
print('ref_text', ref_text)
|