katuni4ka commited on
Commit
80ae08b
1 Parent(s): 1dc8b9e

Update modeling_minicpmv.py

Browse files
Files changed (1) hide show
  1. modeling_minicpmv.py +2 -2
modeling_minicpmv.py CHANGED
@@ -186,7 +186,7 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
186
  terminators = None
187
  if tokenizer is not None:
188
  terminators = [tokenizer.convert_tokens_to_ids(i) for i in self.terminators]
189
- kwargs.pop("image_sizes")
190
  output = self.llm.generate(
191
  inputs_embeds=inputs_embeds,
192
  # pad_token_id=0,
@@ -392,7 +392,7 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
392
 
393
  generation_config.update((k, kwargs[k]) for k in generation_config.keys() & kwargs.keys())
394
 
395
- inputs.pop("image_sizes")
396
  with torch.inference_mode():
397
  res = self.generate(
398
  **inputs,
 
186
  terminators = None
187
  if tokenizer is not None:
188
  terminators = [tokenizer.convert_tokens_to_ids(i) for i in self.terminators]
189
+ kwargs.pop("image_sizes", None)
190
  output = self.llm.generate(
191
  inputs_embeds=inputs_embeds,
192
  # pad_token_id=0,
 
392
 
393
  generation_config.update((k, kwargs[k]) for k in generation_config.keys() & kwargs.keys())
394
 
395
+ inputs.pop("image_sizes", None)
396
  with torch.inference_mode():
397
  res = self.generate(
398
  **inputs,