Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 = {",":
|
| 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 =
|
| 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
|