Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,9 +34,9 @@ def retrieve_answer(question, goals):
|
|
34 |
model_pipeline=pipelines,
|
35 |
question=question,
|
36 |
goals=goals) as q:
|
37 |
-
f = q.run()
|
38 |
|
39 |
-
return f
|
40 |
|
41 |
|
42 |
##################### Process #####################
|
@@ -68,10 +68,12 @@ def main(conf):
|
|
68 |
question = gr.Textbox(label="Ask a Question",
|
69 |
value=conf["defaults"]["question"])
|
70 |
ask_button = gr.Button("Ask!")
|
71 |
-
model_output = gr.Markdown(
|
|
|
|
|
72 |
ask_button.click(fn=retrieve_answer,
|
73 |
inputs=[question, goals],
|
74 |
-
outputs=model_output)
|
75 |
|
76 |
demo.launch()
|
77 |
|
|
|
34 |
model_pipeline=pipelines,
|
35 |
question=question,
|
36 |
goals=goals) as q:
|
37 |
+
f, c = q.run()
|
38 |
|
39 |
+
return f, c
|
40 |
|
41 |
|
42 |
##################### Process #####################
|
|
|
68 |
question = gr.Textbox(label="Ask a Question",
|
69 |
value=conf["defaults"]["question"])
|
70 |
ask_button = gr.Button("Ask!")
|
71 |
+
model_output = gr.Markdown("### Answer")
|
72 |
+
context_output = gr.components.Textbox(label="Retrieved Context")
|
73 |
+
|
74 |
ask_button.click(fn=retrieve_answer,
|
75 |
inputs=[question, goals],
|
76 |
+
outputs=[model_output,context_output])
|
77 |
|
78 |
demo.launch()
|
79 |
|