Gregniuki commited on
Commit
3992a21
·
verified ·
1 Parent(s): 1933936

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.5 * (len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (15 - audio.shape[-1] / sr )))
418
- print(f"text: {gen_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):