finalf0 commited on
Commit
dee672b
1 Parent(s): 09b758e

Update code

Browse files
Files changed (1) hide show
  1. modeling_minicpmv.py +8 -0
modeling_minicpmv.py CHANGED
@@ -208,6 +208,14 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
208
  result_text.append(tokenizer.decode(result).strip())
209
  return result_text
210
 
 
 
 
 
 
 
 
 
211
  def get_slice_image_placeholder(self, image, tokenizer):
212
  image_placeholder = (
213
  tokenizer.im_start
 
208
  result_text.append(tokenizer.decode(result).strip())
209
  return result_text
210
 
211
+ def slice_image(self, image):
212
+ return slice_image(
213
+ image,
214
+ self.config.max_slice_nums,
215
+ self.config.scale_resolution,
216
+ self.config.patch_size,
217
+ )
218
+
219
  def get_slice_image_placeholder(self, image, tokenizer):
220
  image_placeholder = (
221
  tokenizer.im_start