kastan commited on
Commit
95890a2
Β·
1 Parent(s): d2baf43

trying with none chat, history still there

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -128,20 +128,29 @@ def predict(
128
 
129
  print("1. final_chat_response:", final_chat_response)
130
  print("1. history:", history)
 
 
 
 
 
 
 
 
 
131
 
132
  # Pinecone context retrieval
133
  top_context_list = ta.retrieve_contexts_from_pinecone(user_question=inputs, topk=NUM_ANSWERS_GENERATED)
134
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], []
135
  print("2. final_chat_response", final_chat_response)
136
  print("2. history:", history)
137
- yield final_chat_response, history, top_context_list[0], top_context_list[1], top_context_list[2], []
138
 
139
  print("3. final_chat_response", final_chat_response)
140
  print("3. history:", history)
141
  # run CLIP
142
  images_list = ta.clip_text_to_image(inputs)
143
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
144
- yield final_chat_response, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
145
 
146
 
147
  def reset_textbox():
 
128
 
129
  print("1. final_chat_response:", final_chat_response)
130
  print("1. history:", history)
131
+
132
+ # nested list, lame.
133
+ cleaned_final_chat_response = []
134
+ for human_chat, bot_chat in final_chat_response:
135
+ human_chat = human_chat.replace("<br>", "")
136
+ bot_chat = bot_chat.replace("<br>", "")
137
+ cleaned_final_chat_response.append( (human_chat, bot_chat) )
138
+
139
+ print(">>>>>>>>>>>> KEYY. final_chat_response -- AFTER CLEANING -----:", cleaned_final_chat_response)
140
 
141
  # Pinecone context retrieval
142
  top_context_list = ta.retrieve_contexts_from_pinecone(user_question=inputs, topk=NUM_ANSWERS_GENERATED)
143
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], []
144
  print("2. final_chat_response", final_chat_response)
145
  print("2. history:", history)
146
+ yield None, history, top_context_list[0], top_context_list[1], top_context_list[2], []
147
 
148
  print("3. final_chat_response", final_chat_response)
149
  print("3. history:", history)
150
  # run CLIP
151
  images_list = ta.clip_text_to_image(inputs)
152
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
153
+ yield None, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
154
 
155
 
156
  def reset_textbox():