abhi001vj commited on
Commit
e2e0e89
β€’
1 Parent(s): acd3936

fixed the app

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -70,6 +70,7 @@ st.set_page_config(page_title="Haystack Demo", page_icon="https://haystack.deeps
70
  # Persistent state
71
  set_state_if_absent("question", DEFAULT_QUESTION_AT_STARTUP)
72
  set_state_if_absent("answer", DEFAULT_ANSWER_AT_STARTUP)
 
73
 
74
 
75
  # Small callback to reset the interface in case the text of the question changes
@@ -145,7 +146,7 @@ if run_pressed:
145
  ):
146
  try:
147
  st.session_state.results = query(
148
- question, top_k_reader=top_k_reader, top_k_retriever=top_k_retriever
149
  )
150
  except JSONDecodeError as je:
151
  st.error("πŸ‘“    An error occurred reading the results. Is the document store working?")
@@ -154,7 +155,7 @@ if run_pressed:
154
  if "The server is busy processing requests" in str(e) or "503" in str(e):
155
  st.error("πŸ§‘β€πŸŒΎ    All our workers are busy! Try again later.")
156
  else:
157
- st.error("🐞    An error occurred during the request.")
158
 
159
 
160
  if st.session_state.results:
 
70
  # Persistent state
71
  set_state_if_absent("question", DEFAULT_QUESTION_AT_STARTUP)
72
  set_state_if_absent("answer", DEFAULT_ANSWER_AT_STARTUP)
73
+ set_state_if_absent("results", None)
74
 
75
 
76
  # Small callback to reset the interface in case the text of the question changes
 
146
  ):
147
  try:
148
  st.session_state.results = query(
149
+ pipe, question, top_k_reader=top_k_reader, top_k_retriever=top_k_retriever
150
  )
151
  except JSONDecodeError as je:
152
  st.error("πŸ‘“    An error occurred reading the results. Is the document store working?")
 
155
  if "The server is busy processing requests" in str(e) or "503" in str(e):
156
  st.error("πŸ§‘β€πŸŒΎ    All our workers are busy! Try again later.")
157
  else:
158
+ st.error(f"🐞    An error occurred during the request. {str(e)}")
159
 
160
 
161
  if st.session_state.results: