Vision-CAIR commited on
Commit
69b03ec
β€’
1 Parent(s): 25c993b

Update minigpt4/conversation/conversation.py

Browse files
minigpt4/conversation/conversation.py CHANGED
@@ -196,7 +196,7 @@ class Chat:
196
 
197
  def encode_img(self, img_list):
198
  image = img_list[0]
199
- img_list.clear()
200
  if isinstance(image, str): # is a image path
201
  raw_image = Image.open(image).convert('RGB')
202
  image = self.vis_processor(raw_image).unsqueeze(0).to(self.device)
@@ -235,4 +235,3 @@ class Chat:
235
  mixed_embs = torch.cat(mixed_embs, dim=1)
236
  return mixed_embs
237
 
238
-
 
196
 
197
  def encode_img(self, img_list):
198
  image = img_list[0]
199
+ img_list.pop(0)
200
  if isinstance(image, str): # is a image path
201
  raw_image = Image.open(image).convert('RGB')
202
  image = self.vis_processor(raw_image).unsqueeze(0).to(self.device)
 
235
  mixed_embs = torch.cat(mixed_embs, dim=1)
236
  return mixed_embs
237