Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -464,7 +464,7 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
|
|
464 |
audio, sr = torchaudio.load(ref_audio)
|
465 |
|
466 |
# Use the new chunk_text function to split gen_text
|
467 |
-
max_chars = int(
|
468 |
print(f"text: {max_chars} ")
|
469 |
gen_text_batches = chunk_text(gen_text, max_chars=max_chars)
|
470 |
print('ref_text', ref_text)
|
|
|
464 |
audio, sr = torchaudio.load(ref_audio)
|
465 |
|
466 |
# Use the new chunk_text function to split gen_text
|
467 |
+
max_chars = int((len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (25 - audio.shape[-1] / sr )))
|
468 |
print(f"text: {max_chars} ")
|
469 |
gen_text_batches = chunk_text(gen_text, max_chars=max_chars)
|
470 |
print('ref_text', ref_text)
|