teowu commited on
Commit
a118490
1 Parent(s): 798d795

Upload modeling_mplug_owl2.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. modeling_mplug_owl2.py +1 -0
modeling_mplug_owl2.py CHANGED
@@ -59,6 +59,7 @@ def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOKEN_INDEX
59
  return input_ids
60
 
61
  def expand2square(pil_img, background_color):
 
62
  width, height = pil_img.size
63
  if width == height:
64
  return pil_img
 
59
  return input_ids
60
 
61
  def expand2square(pil_img, background_color):
62
+ from PIL import Image
63
  width, height = pil_img.size
64
  if width == height:
65
  return pil_img