Spaces:
Sleeping
Sleeping
Commit
·
e76cc55
1
Parent(s):
57a4556
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,18 +46,9 @@ def generate_output(name, horoscope_type):
|
|
| 46 |
return output_video_path, None
|
| 47 |
return None, "No se pudo generar el video"
|
| 48 |
|
| 49 |
-
name_input = gr.inputs.Textbox(lines=1,
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
{"label": "Egipcio", "value": "egipcio"},
|
| 53 |
-
{"label": "Griego", "value": "griego"},
|
| 54 |
-
{"label": "Maya", "value": "maya"},
|
| 55 |
-
{"label": "Chino", "value": "chino"}
|
| 56 |
-
]
|
| 57 |
-
|
| 58 |
-
horoscope_type_radio = gr.inputs.Radio(horoscope_type_options, label="Tipo de Horóscopo")
|
| 59 |
-
|
| 60 |
-
output = gr.outputs.Video(label="Respuesta de Andrea (dos minutos aproximadamente)").style(width=590)
|
| 61 |
|
| 62 |
def generate_and_display_output(name, horoscope_type):
|
| 63 |
video_path, error_message = generate_output(name, horoscope_type)
|
|
@@ -68,16 +59,13 @@ def generate_and_display_output(name, horoscope_type):
|
|
| 68 |
|
| 69 |
iface = gr.Interface(
|
| 70 |
fn=generate_and_display_output,
|
| 71 |
-
inputs=[
|
| 72 |
-
name_input,
|
| 73 |
-
horoscope_type_radio
|
| 74 |
-
],
|
| 75 |
outputs=output,
|
| 76 |
title="Horóscopo con Inteligencia Artificial v2.1",
|
| 77 |
-
description="
|
| 78 |
layout="vertical",
|
| 79 |
theme="dark",
|
| 80 |
live=False
|
| 81 |
)
|
| 82 |
|
| 83 |
-
iface.launch()
|
|
|
|
| 46 |
return output_video_path, None
|
| 47 |
return None, "No se pudo generar el video"
|
| 48 |
|
| 49 |
+
name_input = gr.inputs.Textbox(lines=1, placeholder="Nombre")
|
| 50 |
+
horoscope_type_radio = gr.inputs.Radio(["Egipcio", "Griego", "Maya", "Chino"], label=None)
|
| 51 |
+
output = gr.outputs.Video(label=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
def generate_and_display_output(name, horoscope_type):
|
| 54 |
video_path, error_message = generate_output(name, horoscope_type)
|
|
|
|
| 59 |
|
| 60 |
iface = gr.Interface(
|
| 61 |
fn=generate_and_display_output,
|
| 62 |
+
inputs=[name_input, horoscope_type_radio],
|
|
|
|
|
|
|
|
|
|
| 63 |
outputs=output,
|
| 64 |
title="Horóscopo con Inteligencia Artificial v2.1",
|
| 65 |
+
description="Ingresa tu nombre y selecciona el tipo de horóscopo.",
|
| 66 |
layout="vertical",
|
| 67 |
theme="dark",
|
| 68 |
live=False
|
| 69 |
)
|
| 70 |
|
| 71 |
+
iface.launch()
|