tykiww commited on
Commit
b87318d
1 Parent(s): c24d1b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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(label="Answer")
 
 
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