Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,9 @@ def process_transcripts(files, context):
|
|
27 |
return "Completed Loading Data"
|
28 |
|
29 |
@spaces.GPU
|
30 |
-
def retrieve_answer(question, goals):
|
31 |
-
|
|
|
32 |
with QAService(conf,
|
33 |
pinecone=pinecones,
|
34 |
model_pipeline=pipelines,
|
@@ -91,6 +92,9 @@ def main(conf):
|
|
91 |
|
92 |
# Meeting Question & Answer Page
|
93 |
with gr.TabItem(conf["layout"]["page_names"][2]):
|
|
|
|
|
|
|
94 |
question = gr.Textbox(label="Ask a Question",
|
95 |
value=conf["defaults"]["question"])
|
96 |
ask_button = gr.Button("Ask!")
|
@@ -98,7 +102,7 @@ def main(conf):
|
|
98 |
context_output = gr.components.Textbox(label="Retrieved Context")
|
99 |
|
100 |
ask_button.click(fn=retrieve_answer,
|
101 |
-
inputs=[question, goals],
|
102 |
outputs=[model_output,context_output])
|
103 |
|
104 |
demo.launch()
|
|
|
27 |
return "Completed Loading Data"
|
28 |
|
29 |
@spaces.GPU
|
30 |
+
def retrieve_answer(question, goals, session_key):
|
31 |
+
sess_key = session_key
|
32 |
+
|
33 |
with QAService(conf,
|
34 |
pinecone=pinecones,
|
35 |
model_pipeline=pipelines,
|
|
|
92 |
|
93 |
# Meeting Question & Answer Page
|
94 |
with gr.TabItem(conf["layout"]["page_names"][2]):
|
95 |
+
session_key = gr.Textbox(label="Paste Session key here.",
|
96 |
+
value="")
|
97 |
+
|
98 |
question = gr.Textbox(label="Ask a Question",
|
99 |
value=conf["defaults"]["question"])
|
100 |
ask_button = gr.Button("Ask!")
|
|
|
102 |
context_output = gr.components.Textbox(label="Retrieved Context")
|
103 |
|
104 |
ask_button.click(fn=retrieve_answer,
|
105 |
+
inputs=[question, goals, session_key],
|
106 |
outputs=[model_output,context_output])
|
107 |
|
108 |
demo.launch()
|