vishwask commited on
Commit
77cb3a8
1 Parent(s): 55d67a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -169,6 +169,8 @@ def get_message_history():
169
  yield f"{role.title()}: {content}"
170
 
171
 
 
 
172
  if prompt := st.chat_input("How can I help you today?"):
173
  st.session_state.messages.append({"role": "user", "content": prompt})
174
  with st.chat_message("user"):
@@ -178,7 +180,6 @@ if prompt := st.chat_input("How can I help you today?"):
178
  full_response = ""
179
  message_history = "\n".join(list(get_message_history())[-3:])
180
  logger.info(f"{user_session_id} Message History: {message_history}")
181
- qa_chain = load_model()
182
  # question = st.text_input("Ask your question", placeholder="Try to include context in your question",
183
  # disabled=not uploaded_file,)
184
  result = qa_chain(prompt)
 
169
  yield f"{role.title()}: {content}"
170
 
171
 
172
+ qa_chain = load_model()
173
+
174
  if prompt := st.chat_input("How can I help you today?"):
175
  st.session_state.messages.append({"role": "user", "content": prompt})
176
  with st.chat_message("user"):
 
180
  full_response = ""
181
  message_history = "\n".join(list(get_message_history())[-3:])
182
  logger.info(f"{user_session_id} Message History: {message_history}")
 
183
  # question = st.text_input("Ask your question", placeholder="Try to include context in your question",
184
  # disabled=not uploaded_file,)
185
  result = qa_chain(prompt)