Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -414,8 +414,8 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
|
|
414 |
audio, sr = torchaudio.load(ref_audio)
|
415 |
|
416 |
# Use the new chunk_text function to split gen_text
|
417 |
-
max_chars = int(0.
|
418 |
-
print(f"text: {
|
419 |
gen_text_batches = chunk_text(gen_text, max_chars=100)
|
420 |
print('ref_text', ref_text)
|
421 |
for i, batch_text in enumerate(gen_text_batches):
|
|
|
414 |
audio, sr = torchaudio.load(ref_audio)
|
415 |
|
416 |
# Use the new chunk_text function to split gen_text
|
417 |
+
max_chars = int(0.333 * (len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (18 - audio.shape[-1] / sr )))
|
418 |
+
print(f"text: {max_chars} ")
|
419 |
gen_text_batches = chunk_text(gen_text, max_chars=100)
|
420 |
print('ref_text', ref_text)
|
421 |
for i, batch_text in enumerate(gen_text_batches):
|