Spaces:
Running
Running
ubermenchh
commited on
Commit
•
b3aac74
1
Parent(s):
d3c9a71
Update app.py
Browse files
app.py
CHANGED
@@ -37,10 +37,6 @@ def infer(question):
|
|
37 |
response = query_engine.query(question)
|
38 |
return str(response)
|
39 |
|
40 |
-
def summarize(history, text='Give a brief summary of the paper under the title `Summary` and the summarize each section of this paper seperately in detailed points.'):
|
41 |
-
history = history + [(text, None)]
|
42 |
-
return history, ''
|
43 |
-
|
44 |
with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
45 |
with gr.Column():
|
46 |
chatbot = gr.Chatbot([], elem_id='chatbot')
|
@@ -56,7 +52,7 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
56 |
submit_btn = gr.Button('Submit')
|
57 |
|
58 |
load_paper.click(paper_changes, inputs=[paper_id], outputs=[langchain_status], queue=False)
|
59 |
-
summary.click(
|
60 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(bot, chatbot, chatbot)
|
61 |
submit_btn.click(add_text, [chatbot, question], [chatbot, question]).then(bot, chatbot, chatbot)
|
62 |
|
|
|
37 |
response = query_engine.query(question)
|
38 |
return str(response)
|
39 |
|
|
|
|
|
|
|
|
|
40 |
with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
41 |
with gr.Column():
|
42 |
chatbot = gr.Chatbot([], elem_id='chatbot')
|
|
|
52 |
submit_btn = gr.Button('Submit')
|
53 |
|
54 |
load_paper.click(paper_changes, inputs=[paper_id], outputs=[langchain_status], queue=False)
|
55 |
+
summary.click(add_text, [chatbot, 'Give a brief summary of the paper under the title `Summary` and the summarize each section of this paper seperately in detailed points.'], [chatbot, 'Give a brief summary of the paper under the title `Summary` and the summarize each section of this paper seperately in detailed points.']).then(bot, chatbot, chatbot)
|
56 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(bot, chatbot, chatbot)
|
57 |
submit_btn.click(add_text, [chatbot, question], [chatbot, question]).then(bot, chatbot, chatbot)
|
58 |
|