jchen8000 commited on
Commit
618a80a
·
verified ·
1 Parent(s): 5fd10f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -133,7 +133,7 @@ def generate_response(query, history, model, temperature, max_tokens, top_p, see
133
 
134
  response = rag_chain.invoke(query)
135
 
136
- return response, relevant_info
137
 
138
 
139
 
@@ -162,27 +162,21 @@ with gr.Blocks(theme="Nymbo/Alyx_Theme") as demo:
162
 
163
  with gr.Tab("Chatbot"):
164
  with gr.Row():
165
- # with gr.Column():
166
- # relevant_info = gr.Textbox(
167
- # label="Retrieved Information",
168
- # interactive=False,
169
- # lines=20,
170
- # )
171
  with gr.Column():
172
- relevant_info = gr.Textbox(
173
- label="Retrieved Information",
174
- interactive=False,
175
- lines=20,
176
- )
177
  gr.ChatInterface(
178
  fn=generate_response,
179
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
180
  examples=examples_questions,
181
  additional_inputs=additional_inputs,
182
- additional_outputs=[relevant_info],
183
  cache_examples=False,
184
  )
185
-
 
 
 
 
 
186
 
187
  # Launch the Gradio app
188
  demo.launch(share=True)
 
133
 
134
  response = rag_chain.invoke(query)
135
 
136
+ return relevant_info
137
 
138
 
139
 
 
162
 
163
  with gr.Tab("Chatbot"):
164
  with gr.Row():
 
 
 
 
 
 
165
  with gr.Column():
 
 
 
 
 
166
  gr.ChatInterface(
167
  fn=generate_response,
168
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
169
  examples=examples_questions,
170
  additional_inputs=additional_inputs,
171
+ # additional_outputs=[relevant_info],
172
  cache_examples=False,
173
  )
174
+ # with gr.Column():
175
+ # relevant_info = gr.Textbox(
176
+ # label="Retrieved Information",
177
+ # interactive=False,
178
+ # lines=20,
179
+ # )
180
 
181
  # Launch the Gradio app
182
  demo.launch(share=True)