Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ from pydub import AudioSegment
|
|
8 |
tts_juan = TTS(model_name="tts_models/es/mai/tacotron2-DDC", progress_bar=False, gpu=False)
|
9 |
tts_maria = TTS(model_name="tts_models/es/css10/vits", progress_bar=False, gpu=False)
|
10 |
|
11 |
-
# Modelo de resumen
|
12 |
-
resumidor = pipeline("summarization", model="
|
13 |
|
14 |
# Funci贸n para convertir texto a audio con voces diferentes
|
15 |
def convertir_texto_a_audio(texto, nombre_archivo, voz):
|
@@ -70,8 +70,8 @@ def transformar_texto(archivo):
|
|
70 |
try:
|
71 |
resumen = resumidor(
|
72 |
texto,
|
73 |
-
max_length=
|
74 |
-
min_length=
|
75 |
do_sample=False,
|
76 |
clean_up_tokenization_spaces=True
|
77 |
)[0]['summary_text']
|
@@ -126,3 +126,4 @@ interfaz = gr.Interface(
|
|
126 |
)
|
127 |
|
128 |
interfaz.launch()
|
|
|
|
8 |
tts_juan = TTS(model_name="tts_models/es/mai/tacotron2-DDC", progress_bar=False, gpu=False)
|
9 |
tts_maria = TTS(model_name="tts_models/es/css10/vits", progress_bar=False, gpu=False)
|
10 |
|
11 |
+
# Modelo de resumen compatible con espa帽ol
|
12 |
+
resumidor = pipeline("summarization", model="mrm8488/bert-small2bert-small-finetuned-cnn_daily_mail-summarization")
|
13 |
|
14 |
# Funci贸n para convertir texto a audio con voces diferentes
|
15 |
def convertir_texto_a_audio(texto, nombre_archivo, voz):
|
|
|
70 |
try:
|
71 |
resumen = resumidor(
|
72 |
texto,
|
73 |
+
max_length=130, # Ajusta seg煤n las capacidades del modelo
|
74 |
+
min_length=30,
|
75 |
do_sample=False,
|
76 |
clean_up_tokenization_spaces=True
|
77 |
)[0]['summary_text']
|
|
|
126 |
)
|
127 |
|
128 |
interfaz.launch()
|
129 |
+
|