[Model] Support Unlimited OCR (#46564)
Signed-off-by: Tianyu Guo <guoty9@mail2.sysu.edu.cn> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Roger Wang <hey@rogerw.io>
This commit is contained in:
co-authored by
Isotr0py
Roger Wang
parent
a65f93fb2e
commit
c6741b2ad4
@@ -220,8 +220,10 @@ class DeepseekOCRProcessingInfo(BaseProcessingInfo):
|
||||
patch_size = 16
|
||||
downsample_ratio = 4
|
||||
|
||||
if CROP_MODE:
|
||||
if image_width <= 640 and image_height <= 640:
|
||||
# Use the caller-supplied `cropping` flag so that callers that disable
|
||||
# crop mode for multi-image requests get a consistent token count.
|
||||
if cropping:
|
||||
if image_width <= IMAGE_SIZE and image_height <= IMAGE_SIZE:
|
||||
crop_ratio = [1, 1]
|
||||
else:
|
||||
# find the closest aspect ratio to the target
|
||||
|
||||
Reference in New Issue
Block a user