Spaces:
Sleeping
Sleeping
Lautaro Cardarelli
commited on
Commit
·
3fb83c0
1
Parent(s):
a552682
mix interfaces
Browse files
app.py
CHANGED
|
@@ -95,31 +95,16 @@ def generate_summary(text):
|
|
| 95 |
return summary
|
| 96 |
|
| 97 |
|
| 98 |
-
def process(text):
|
| 99 |
-
return generate_summary(text), generate_questions(text)
|
| 100 |
|
| 101 |
|
| 102 |
textbox_input = gr.Textbox(label="Pega el text aca:", placeholder="Texto...", lines=15)
|
|
|
|
| 103 |
summary_output = gr.Textbox(label="Resumen", lines=15)
|
| 104 |
-
questions_output = gr.Textbox(label="Preguntas", lines=5)
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
-
demo = gr.Interface(fn=process, inputs=textbox_input, outputs=[summary_output, questions_output])
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
def chatbot_response(user_input):
|
| 111 |
-
return f"Chatbot dice: {user_input}"
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
chat_input = gr.Textbox(label="Pregunta sobre el texto:", placeholder="Mensaje...", lines=5)
|
| 115 |
-
chat_output = gr.Textbox(label="Chatbot", lines=10)
|
| 116 |
-
|
| 117 |
-
chatbot_interface = gr.Interface(
|
| 118 |
-
fn=chatbot_response,
|
| 119 |
-
inputs=chat_input,
|
| 120 |
-
outputs=chat_output,
|
| 121 |
-
title="Chatbot"
|
| 122 |
-
)
|
| 123 |
-
|
| 124 |
-
chatbot_interface.launch()
|
| 125 |
-
demo.launch()
|
|
|
|
| 95 |
return summary
|
| 96 |
|
| 97 |
|
| 98 |
+
def process(text, question):
|
| 99 |
+
return generate_summary(text), generate_questions(text), question
|
| 100 |
|
| 101 |
|
| 102 |
textbox_input = gr.Textbox(label="Pega el text aca:", placeholder="Texto...", lines=15)
|
| 103 |
+
question_input = gr.Textbox(label="Pregunta sobre el texto aca:", placeholder="Mensaje...", lines=15)
|
| 104 |
summary_output = gr.Textbox(label="Resumen", lines=15)
|
| 105 |
+
questions_output = gr.Textbox(label="Preguntas de guia generadas", lines=5)
|
| 106 |
+
questions_response = gr.Textbox(label="Respuestas", lines=5)
|
| 107 |
|
| 108 |
|
| 109 |
+
demo = gr.Interface(fn=process, inputs=[textbox_input, question_input], outputs=[summary_output, questions_output, questions_response])
|
| 110 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|