Spaces:
Runtime error
Runtime error
Alberto Carmona
commited on
Commit
·
47b18b6
1
Parent(s):
d09c5a0
Hide a label
Browse files
app.py
CHANGED
@@ -1,12 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
3 |
def update(name='default text'):
|
4 |
return f"Welcome to Gradio, {name}!"
|
5 |
|
|
|
6 |
with gr.Blocks() as demo:
|
7 |
-
gr.Markdown(
|
|
|
8 |
with gr.Column():
|
9 |
-
inp_url = gr.Textbox(placeholder="URL"
|
|
|
10 |
btn_extract_text = gr.Button("Extraer texto")
|
11 |
gr.Markdown("Texto extraído.")
|
12 |
out_url_text = gr.Textbox()
|
@@ -20,8 +24,9 @@ with gr.Blocks() as demo:
|
|
20 |
# Question generation section
|
21 |
btn_question_gen = gr.Button("Pregúntame algo sobre el contenido")
|
22 |
out_question_gen = gr.Textbox()
|
23 |
-
btn_question_gen.click(fn=update, inputs=out_url_text,
|
24 |
-
|
|
|
25 |
btn_question_gen = gr.Button("Muestra contexto de la respuesta")
|
26 |
out_question_answer = gr.Textbox()
|
27 |
btn_question_gen.click(fn=update, outputs=out_question_answer)
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
|
4 |
def update(name='default text'):
|
5 |
return f"Welcome to Gradio, {name}!"
|
6 |
|
7 |
+
|
8 |
with gr.Blocks() as demo:
|
9 |
+
gr.Markdown(
|
10 |
+
"Introduzca la URL que tiene el contenido sobre el cual desea aprender.")
|
11 |
with gr.Column():
|
12 |
+
inp_url = gr.Textbox(placeholder="URL",
|
13 |
+
show_label=False)
|
14 |
btn_extract_text = gr.Button("Extraer texto")
|
15 |
gr.Markdown("Texto extraído.")
|
16 |
out_url_text = gr.Textbox()
|
|
|
24 |
# Question generation section
|
25 |
btn_question_gen = gr.Button("Pregúntame algo sobre el contenido")
|
26 |
out_question_gen = gr.Textbox()
|
27 |
+
btn_question_gen.click(fn=update, inputs=out_url_text,
|
28 |
+
outputs=out_question_gen)
|
29 |
+
|
30 |
btn_question_gen = gr.Button("Muestra contexto de la respuesta")
|
31 |
out_question_answer = gr.Textbox()
|
32 |
btn_question_gen.click(fn=update, outputs=out_question_answer)
|