Tuana commited on
Commit
bbf4ec6
Β·
1 Parent(s): af7af58

update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -15,7 +15,7 @@ sidebar()
15
 
16
  st.write("# 🐀 What have they been posting about lately on Mastodon?")
17
 
18
- if st.session_state.get("H"):
19
  pipeline = start_haystack(st.session_state.get("HUGGING_FACE_TOKEN"))
20
  st.session_state["api_key_configured"] = True
21
  search_bar, button = st.columns(2)
@@ -33,16 +33,16 @@ else:
33
 
34
  if st.session_state.get("api_key_configured"):
35
  run_query = (
36
- run_pressed or username != st.session_state.username
37
  )
38
 
39
  # Get results for query
40
- if run_query and username:
41
  reset_results()
42
- st.session_state.username = username
43
  with st.spinner("πŸ”Ž"):
44
  try:
45
- st.session_state.result = query(username, pipeline)
46
  except JSONDecodeError as je:
47
  st.error(
48
  "πŸ‘“    An error occurred reading the results. Is the document store working?"
 
15
 
16
  st.write("# 🐀 What have they been posting about lately on Mastodon?")
17
 
18
+ if st.session_state.get("HUGGING_FACE_TOKEN"):
19
  pipeline = start_haystack(st.session_state.get("HUGGING_FACE_TOKEN"))
20
  st.session_state["api_key_configured"] = True
21
  search_bar, button = st.columns(2)
 
33
 
34
  if st.session_state.get("api_key_configured"):
35
  run_query = (
36
+ run_pressed or question != st.session_state.question
37
  )
38
 
39
  # Get results for query
40
+ if run_query and question:
41
  reset_results()
42
+ st.session_state.question = question
43
  with st.spinner("πŸ”Ž"):
44
  try:
45
+ st.session_state.result = query(question, pipeline)
46
  except JSONDecodeError as je:
47
  st.error(
48
  "πŸ‘“    An error occurred reading the results. Is the document store working?"