Gregniuki commited on
Commit
527920c
·
verified ·
1 Parent(s): 7f7a729

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -231,7 +231,7 @@ def infer_batch(ref_audio, ref_text, gen_text_batches, exp_name, remove_silence,
231
  ref_text = ref_text + " "
232
 
233
  # Define weights for characters
234
- punctuation_weights = {",": 3, ".": 3, " ": 3} # Add more punctuation as needed
235
 
236
  for i, gen_text in enumerate(progress.tqdm(gen_text_batches)):
237
  # Prepare the text
@@ -250,7 +250,7 @@ def infer_batch(ref_audio, ref_text, gen_text_batches, exp_name, remove_silence,
250
  additional_length = sum(punctuation_weights.get(char, 0) for char in text)
251
  return length + additional_length
252
 
253
- ref_text_len = len(ref_text.encode("utf-8"))
254
  gen_text_len = calculate_weighted_length(gen_text)
255
 
256
  # Duration calculation considering global speed factor
 
231
  ref_text = ref_text + " "
232
 
233
  # Define weights for characters
234
+ punctuation_weights = {",": 2, ".": 3, " ": 1} # Add more punctuation as needed
235
 
236
  for i, gen_text in enumerate(progress.tqdm(gen_text_batches)):
237
  # Prepare the text
 
250
  additional_length = sum(punctuation_weights.get(char, 0) for char in text)
251
  return length + additional_length
252
 
253
+ ref_text_len = calculate_weighted_length(ref_text)
254
  gen_text_len = calculate_weighted_length(gen_text)
255
 
256
  # Duration calculation considering global speed factor