chendl commited on
Commit
1fb7e67
1 Parent(s): 674dd26

update chat

Browse files
multimodal/open_flamingo/chat/conversation.py CHANGED
@@ -368,16 +368,26 @@ class Chat:
368
  image_nums = [1] * len(input_ids)
369
  # and torch.cuda.amp.autocast(dtype=torch.float16)
370
  with torch.no_grad():
371
- outputs = self.model.generate(
372
- batch_images,
373
- input_ids,
374
  attention_mask=attention_mask,
375
- max_new_tokens=100,
376
- # min_new_tokens=8,
377
- num_beams=1,
378
- image_start_index_list=image_start_index_list,
379
  image_nums=image_nums,
 
 
 
380
  )
 
 
 
 
 
 
 
 
 
 
 
381
  boxes = outputs["boxes"]
382
  scores = outputs["scores"]
383
  if len(scores) > 0:
 
368
  image_nums = [1] * len(input_ids)
369
  # and torch.cuda.amp.autocast(dtype=torch.float16)
370
  with torch.no_grad():
371
+ outputs = model(
372
+ vision_x=vision_x,
373
+ lang_x=lang_x,
374
  attention_mask=attention_mask,
 
 
 
 
375
  image_nums=image_nums,
376
+ image_start_index_list=image_start_index_list,
377
+ added_bbox_list=None,
378
+ add_box=False,
379
  )
380
+ # with torch.no_grad():
381
+ # outputs = self.model.generate(
382
+ # batch_images,
383
+ # input_ids,
384
+ # attention_mask=attention_mask,
385
+ # max_new_tokens=100,
386
+ # # min_new_tokens=8,
387
+ # num_beams=1,
388
+ # image_start_index_list=image_start_index_list,
389
+ # image_nums=image_nums,
390
+ # )
391
  boxes = outputs["boxes"]
392
  scores = outputs["scores"]
393
  if len(scores) > 0: