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

update chat

Browse files
multimodal/open_flamingo/chat/conversation.py CHANGED
@@ -361,8 +361,8 @@ class Chat:
361
  return_tensors="pt",
362
  max_length=2000,
363
  )
364
- input_ids = encodings["input_ids"].to("cuda")
365
- attention_mask = encodings["attention_mask"].to("cuda")
366
  image_start_index_list = ((input_ids == media_token_id).nonzero(as_tuple=True)[-1] + 1).tolist()
367
  image_start_index_list = [[x] for x in image_start_index_list]
368
  image_nums = [1] * len(input_ids)
@@ -466,7 +466,7 @@ def evaluate_exp(
466
  image = Image.open(image_path).convert("RGB")
467
  image = image.resize((size, size))
468
  print(f"image size: {image.size}")
469
- batch_images = preprocess_image(image, image_processor).unsqueeze(0).unsqueeze(1).unsqueeze(0).to("cuda")
470
  conversation = []
471
  human_sentence = None
472
  while True:
 
361
  return_tensors="pt",
362
  max_length=2000,
363
  )
364
+ input_ids = encodings["input_ids"]
365
+ attention_mask = encodings["attention_mask"]
366
  image_start_index_list = ((input_ids == media_token_id).nonzero(as_tuple=True)[-1] + 1).tolist()
367
  image_start_index_list = [[x] for x in image_start_index_list]
368
  image_nums = [1] * len(input_ids)
 
466
  image = Image.open(image_path).convert("RGB")
467
  image = image.resize((size, size))
468
  print(f"image size: {image.size}")
469
+ batch_images = preprocess_image(image, image_processor).unsqueeze(0).unsqueeze(1).unsqueeze(0)
470
  conversation = []
471
  human_sentence = None
472
  while True: