Spaces:
Sleeping
Sleeping
Commit
路
161fa06
1
Parent(s):
a984705
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,7 @@ def generate_output(name, date_of_birth, image):
|
|
27 |
audio_path = "audio.wav"
|
28 |
audio = AudioSegment.from_mp3(temp_audio_path)
|
29 |
audio.export(audio_path, format="wav")
|
|
|
30 |
except Exception as e:
|
31 |
return None, f"No se pudo generar el audio: {str(e)}"
|
32 |
|
@@ -50,21 +51,15 @@ def error_message_fn(error_message):
|
|
50 |
return None
|
51 |
|
52 |
def image_row():
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
return row
|
58 |
-
|
59 |
-
def select_image(images, name, date_of_birth):
|
60 |
-
return generate_output(name, date_of_birth, images[0])
|
61 |
-
|
62 |
-
input_image_row = gr.inputs.ImageGroup(image_row)
|
63 |
|
64 |
iface = gr.Interface(
|
65 |
-
fn=
|
66 |
inputs=[
|
67 |
-
|
68 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
69 |
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA")
|
70 |
],
|
@@ -72,7 +67,7 @@ iface = gr.Interface(
|
|
72 |
gr.outputs.Video(label="Respuesta de Andrea (un minuto aproximadamente)").style(width=256),
|
73 |
gr.outputs.Textbox(label="Mensaje de error", type="text")
|
74 |
],
|
75 |
-
title="Or谩culo de Inteligencia Artificial v2.
|
76 |
description="Por favor, ingresa tu nombre y fecha de nacimiento."
|
77 |
)
|
78 |
|
|
|
27 |
audio_path = "audio.wav"
|
28 |
audio = AudioSegment.from_mp3(temp_audio_path)
|
29 |
audio.export(audio_path, format="wav")
|
30 |
+
print("Archivo de audio generado:", audio_path)
|
31 |
except Exception as e:
|
32 |
return None, f"No se pudo generar el audio: {str(e)}"
|
33 |
|
|
|
51 |
return None
|
52 |
|
53 |
def image_row():
|
54 |
+
images_html = ""
|
55 |
+
for i in range(1, 7):
|
56 |
+
images_html += f'<img src="{i}.jpg" style="width: 10%; height: 10%;">'
|
57 |
+
return images_html
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
iface = gr.Interface(
|
60 |
+
fn=generate_output,
|
61 |
inputs=[
|
62 |
+
gr.inputs.HTML(label="Selecciona una imagen:", default=image_row()),
|
63 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
64 |
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA")
|
65 |
],
|
|
|
67 |
gr.outputs.Video(label="Respuesta de Andrea (un minuto aproximadamente)").style(width=256),
|
68 |
gr.outputs.Textbox(label="Mensaje de error", type="text")
|
69 |
],
|
70 |
+
title="Or谩culo de Inteligencia Artificial v2.1",
|
71 |
description="Por favor, ingresa tu nombre y fecha de nacimiento."
|
72 |
)
|
73 |
|