Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -157,7 +157,10 @@ def chunk_text(text, max_chars):
|
|
157 |
if max_chars > 105:
|
158 |
max_chars = 105
|
159 |
if max_chars < 40:
|
160 |
-
max_chars =
|
|
|
|
|
|
|
161 |
split_after_space_chars = max_chars + int(max_chars * 0.33)
|
162 |
chunks = []
|
163 |
current_chunk = ""
|
@@ -230,10 +233,11 @@ def infer_batch(ref_audio, ref_text, gen_text_batches, exp_name, remove_silence,
|
|
230 |
generated_waves = []
|
231 |
spectrograms = []
|
232 |
# Remove the last 5 chats, ensuring you don't attempt to slice beyond the list length
|
233 |
-
ref_text = ref_text[:-
|
|
|
234 |
# Ensure ref_text ends with a space if the last character is single-byte
|
235 |
-
if len(ref_text[-1].encode("utf-8")) == 1:
|
236 |
-
|
237 |
|
238 |
# Define weights for characters
|
239 |
punctuation_weights = {",": 3, ".": 3, " ": 3} # Add more punctuation as needed
|
|
|
157 |
if max_chars > 105:
|
158 |
max_chars = 105
|
159 |
if max_chars < 40:
|
160 |
+
max_chars = 40
|
161 |
+
|
162 |
+
|
163 |
+
|
164 |
split_after_space_chars = max_chars + int(max_chars * 0.33)
|
165 |
chunks = []
|
166 |
current_chunk = ""
|
|
|
233 |
generated_waves = []
|
234 |
spectrograms = []
|
235 |
# Remove the last 5 chats, ensuring you don't attempt to slice beyond the list length
|
236 |
+
ref_text = ref_text[:-5] + ". " if len(ref_text) >= 5 else ref_text
|
237 |
+
|
238 |
# Ensure ref_text ends with a space if the last character is single-byte
|
239 |
+
# if len(ref_text[-1].encode("utf-8")) == 1:
|
240 |
+
# ref_text = ref_text + ". "
|
241 |
|
242 |
# Define weights for characters
|
243 |
punctuation_weights = {",": 3, ".": 3, " ": 3} # Add more punctuation as needed
|