eagle0504 commited on
Commit
2320c9b
β€’
1 Parent(s): a43f4e7

spinner organized

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -86,7 +86,7 @@ collection = client.create_collection(combined_string)
86
 
87
 
88
  # Embed and store the first N supports for this demo
89
- with st.spinner("Loading database, please be patient with us ... πŸ™"):
90
  L = len(dataset["train"]["questions"])
91
  collection.add(
92
  ids=[str(i) for i in range(0, L)], # IDs are just strings
@@ -97,13 +97,13 @@ with st.spinner("Loading database, please be patient with us ... πŸ™"):
97
 
98
  # React to user input
99
  if prompt := st.chat_input("Tell me about YSA"):
100
- # Display user message in chat message container
101
- st.chat_message("user").markdown(prompt)
102
- # Add user message to chat history
103
- st.session_state.messages.append({"role": "user", "content": prompt})
 
104
 
105
- question = prompt
106
- with st.spinner("Thinking ..."):
107
  results = collection.query(query_texts=question, n_results=5)
108
  idx = results["ids"][0]
109
  idx = [int(i) for i in idx]
 
86
 
87
 
88
  # Embed and store the first N supports for this demo
89
+ with st.spinner("Loading, please be patient with us ... πŸ™"):
90
  L = len(dataset["train"]["questions"])
91
  collection.add(
92
  ids=[str(i) for i in range(0, L)], # IDs are just strings
 
97
 
98
  # React to user input
99
  if prompt := st.chat_input("Tell me about YSA"):
100
+ with st.spinner("Loading, please be patient with us ... πŸ™"):
101
+ # Display user message in chat message container
102
+ st.chat_message("user").markdown(prompt)
103
+ # Add user message to chat history
104
+ st.session_state.messages.append({"role": "user", "content": prompt})
105
 
106
+ question = prompt
 
107
  results = collection.query(query_texts=question, n_results=5)
108
  idx = results["ids"][0]
109
  idx = [int(i) for i in idx]