alvanlii commited on
Commit
6ee4b37
1 Parent(s): b836d7e

Debug chat state

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -37,10 +37,14 @@ class ChatBotCheese:
37
  def chat(self, input_text, state, ret_scale_factor, num_ims, num_words, temp, chat_state):
38
  chat_state.append(f'Q: {input_text} \nA:')
39
  chat_history = " ".join(chat_state)
 
 
40
  if self.curr_image is not None:
41
- model_outputs = self.model.generate_for_images_and_texts([self.curr_image, chat_history], num_words=num_words, max_num_rets=num_ims, ret_scale_factor=ret_scale_factor, temperature=temp)
42
  else:
43
- model_outputs = self.model.generate_for_images_and_texts([chat_history], max_num_rets=num_ims, num_words=num_words, ret_scale_factor=ret_scale_factor, temperature=temp)
 
 
44
  chat_state.append(' '.join([s for s in model_outputs if type(s) == str]) + '\n')
45
 
46
  im_names = []
 
37
  def chat(self, input_text, state, ret_scale_factor, num_ims, num_words, temp, chat_state):
38
  chat_state.append(f'Q: {input_text} \nA:')
39
  chat_history = " ".join(chat_state)
40
+ model_input = []
41
+ print(chat_history)
42
  if self.curr_image is not None:
43
+ model_input = [self.curr_image, chat_history]
44
  else:
45
+ model_input = [chat_history]
46
+
47
+ model_outputs = self.model.generate_for_images_and_texts(model_input, max_num_rets=num_ims, num_words=num_words, ret_scale_factor=ret_scale_factor, temperature=temp)
48
  chat_state.append(' '.join([s for s in model_outputs if type(s) == str]) + '\n')
49
 
50
  im_names = []