Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,23 @@ app = Flask(__name__)
|
|
12 |
# Define the folder where files are saved
|
13 |
file_folder = '/home/app/'
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
def filter_text(text, model_name):
|
16 |
if model_name in model_names:
|
17 |
replacements = model_names[model_name]["replacements"]
|
@@ -24,6 +41,7 @@ def filter_text(text, model_name):
|
|
24 |
logging.error(f"No se encontró el modelo '{model_name}'.")
|
25 |
return None
|
26 |
|
|
|
27 |
def convert_text_to_speech(parrafo, model):
|
28 |
# Limit text to 500 characters
|
29 |
parrafo = parrafo[:100000]
|
|
|
12 |
# Define the folder where files are saved
|
13 |
file_folder = '/home/app/'
|
14 |
|
15 |
+
|
16 |
+
import logging
|
17 |
+
|
18 |
+
model_names = {
|
19 |
+
"es_MX-claude-14947-epoch-high.onnx": {
|
20 |
+
"replacements": {
|
21 |
+
('(', ','), (')', ','), ('?', ','), ('¿', ','), (':', ','), ('\n', ' ')
|
22 |
+
}
|
23 |
+
},
|
24 |
+
"kamora": {
|
25 |
+
"replacements": {
|
26 |
+
# Define los reemplazos específicos del modelo 2 aquí
|
27 |
+
}
|
28 |
+
},
|
29 |
+
# Agrega más modelos si es necesario
|
30 |
+
}
|
31 |
+
|
32 |
def filter_text(text, model_name):
|
33 |
if model_name in model_names:
|
34 |
replacements = model_names[model_name]["replacements"]
|
|
|
41 |
logging.error(f"No se encontró el modelo '{model_name}'.")
|
42 |
return None
|
43 |
|
44 |
+
|
45 |
def convert_text_to_speech(parrafo, model):
|
46 |
# Limit text to 500 characters
|
47 |
parrafo = parrafo[:100000]
|