kastan commited on
Commit
238b963
Β·
1 Parent(s): 1c64f91

keep the chat history strip list comprehension

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -124,15 +124,17 @@ def predict(
124
  chat = [(history[i].strip(), history[i + 1].strip()) for i in range(0, len(history) - 1, 2)]
125
  yield chat, history, None, None, None, []
126
 
 
 
127
  # Pinecone context retrieval
128
  top_context_list = ta.retrieve_contexts_from_pinecone(user_question=inputs, topk=NUM_ANSWERS_GENERATED)
129
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], []
130
- yield None, None, top_context_list[0], top_context_list[1], top_context_list[2], []
131
 
132
  # run CLIP
133
  images_list = ta.clip_text_to_image(inputs)
134
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
135
- yield None, None, top_context_list[0], top_context_list[1], top_context_list[2], images_list
136
 
137
 
138
  def reset_textbox():
 
124
  chat = [(history[i].strip(), history[i + 1].strip()) for i in range(0, len(history) - 1, 2)]
125
  yield chat, history, None, None, None, []
126
 
127
+ chat = [(history[i].strip(), history[i + 1].strip()) for i in range(0, len(history) - 1, 2)]
128
+
129
  # Pinecone context retrieval
130
  top_context_list = ta.retrieve_contexts_from_pinecone(user_question=inputs, topk=NUM_ANSWERS_GENERATED)
131
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], []
132
+ yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], []
133
 
134
  # run CLIP
135
  images_list = ta.clip_text_to_image(inputs)
136
  # yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
137
+ yield chat, history, top_context_list[0], top_context_list[1], top_context_list[2], images_list
138
 
139
 
140
  def reset_textbox():