ykl7 commited on
Commit
cc075da
·
1 Parent(s): 921698f

change retriever message flow

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -146,6 +146,16 @@ def retriever(query: str, selected_retriever: str):
146
  retriever_endpoint = "ft"
147
  else:
148
  message = "No retriever selected. Skipping document retrieval."
 
 
 
 
 
 
 
 
 
 
149
  return ""
150
 
151
  headers = {
@@ -166,12 +176,6 @@ def retriever(query: str, selected_retriever: str):
166
 
167
  corpus = '\n\n'.join(topk_documents)
168
 
169
- for chunk in message.split():
170
- text += chunk + " "
171
- time.sleep(0.05)
172
- # Add a blinking cursor to simulate typing
173
- placeholder.markdown(text + "▌")
174
- placeholder.markdown(text)
175
  # You could return retrieved info here.
176
  return corpus
177
 
 
146
  retriever_endpoint = "ft"
147
  else:
148
  message = "No retriever selected. Skipping document retrieval."
149
+ retriever_endpoint = "None"
150
+
151
+ for chunk in message.split():
152
+ text += chunk + " "
153
+ time.sleep(0.05)
154
+ # Add a blinking cursor to simulate typing
155
+ placeholder.markdown(text + "▌")
156
+ placeholder.markdown(text)
157
+
158
+ if retriever_endpoint == "None":
159
  return ""
160
 
161
  headers = {
 
176
 
177
  corpus = '\n\n'.join(topk_documents)
178
 
 
 
 
 
 
 
179
  # You could return retrieved info here.
180
  return corpus
181