Spaces:
Sleeping
Sleeping
Lautaro Cardarelli
commited on
Commit
·
f12740c
1
Parent(s):
ba197d5
fix chatbot
Browse files
app.py
CHANGED
|
@@ -146,7 +146,7 @@ class SummarizerAndQA:
|
|
| 146 |
def process_questions(self):
|
| 147 |
return generate_questions(self.input_text)
|
| 148 |
|
| 149 |
-
def process_question_response(self, question):
|
| 150 |
return generate_question_response(question, self.input_text)
|
| 151 |
|
| 152 |
summarizer_and_qa = SummarizerAndQA()
|
|
@@ -166,5 +166,5 @@ questions_response = gr.Textbox(label="Respuestas", lines=5)
|
|
| 166 |
# --------------
|
| 167 |
summarizer_interface = gr.Interface(fn=summarizer_and_qa.process_summarizer, inputs=[textbox_input], outputs=[summary_output], allow_flagging="never")
|
| 168 |
questions_interface = gr.Interface(fn=summarizer_and_qa.process_questions, inputs=[], outputs=[questions_output], allow_flagging="never")
|
| 169 |
-
chatbot_interface = gr.ChatInterface(fn=summarizer_and_qa.process_question_response, type="messages", examples=[
|
| 170 |
gr.TabbedInterface([summarizer_interface, questions_interface, chatbot_interface], ["Resumidor", "Preguntas de guia", "Chatbot"]).launch()
|
|
|
|
| 146 |
def process_questions(self):
|
| 147 |
return generate_questions(self.input_text)
|
| 148 |
|
| 149 |
+
def process_question_response(self, question, history):
|
| 150 |
return generate_question_response(question, self.input_text)
|
| 151 |
|
| 152 |
summarizer_and_qa = SummarizerAndQA()
|
|
|
|
| 166 |
# --------------
|
| 167 |
summarizer_interface = gr.Interface(fn=summarizer_and_qa.process_summarizer, inputs=[textbox_input], outputs=[summary_output], allow_flagging="never")
|
| 168 |
questions_interface = gr.Interface(fn=summarizer_and_qa.process_questions, inputs=[], outputs=[questions_output], allow_flagging="never")
|
| 169 |
+
chatbot_interface = gr.ChatInterface(fn=summarizer_and_qa.process_question_response, type="messages", examples=[], title="Preguntas sobre el texto")
|
| 170 |
gr.TabbedInterface([summarizer_interface, questions_interface, chatbot_interface], ["Resumidor", "Preguntas de guia", "Chatbot"]).launch()
|