Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,10 @@ models_replacements = {
|
|
43 |
def filter_text(text, replacements):
|
44 |
for replacement in replacements:
|
45 |
text = text.replace(replacement[0], replacement[1])
|
|
|
|
|
|
|
|
|
46 |
# Elimina los saltos de línea
|
47 |
text = text.replace('\n', '')
|
48 |
# Define una función de reemplazo usando una función lambda
|
@@ -54,6 +58,7 @@ def filter_text(text, replacements):
|
|
54 |
return filtered_text
|
55 |
|
56 |
|
|
|
57 |
def convert_text_to_speech(parrafo, model):
|
58 |
# Limit text to 500 characters
|
59 |
parrafo = parrafo[:10000]
|
|
|
43 |
def filter_text(text, replacements):
|
44 |
for replacement in replacements:
|
45 |
text = text.replace(replacement[0], replacement[1])
|
46 |
+
# Agrega una barra invertida adicional antes de cada caracter especial
|
47 |
+
special_chars = ['"', "'", '\\']
|
48 |
+
for char in special_chars:
|
49 |
+
text = text.replace(char, '\\' + char)
|
50 |
# Elimina los saltos de línea
|
51 |
text = text.replace('\n', '')
|
52 |
# Define una función de reemplazo usando una función lambda
|
|
|
58 |
return filtered_text
|
59 |
|
60 |
|
61 |
+
|
62 |
def convert_text_to_speech(parrafo, model):
|
63 |
# Limit text to 500 characters
|
64 |
parrafo = parrafo[:10000]
|