Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
80f2ba6e
Unverified
Commit
80f2ba6e
authored
Feb 11, 2026
by
Yichuan Wang
Committed by
GitHub
Feb 11, 2026
Browse files
Fix DeepSeek-OCR tensor validation for all size variants (#34085)
Co-authored-by:
Cursor
<
cursoragent@cursor.com
>
parent
136b0bfa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
vllm/model_executor/models/deepseek_ocr.py
vllm/model_executor/models/deepseek_ocr.py
+11
-1
No files found.
vllm/model_executor/models/deepseek_ocr.py
View file @
80f2ba6e
...
...
@@ -448,7 +448,16 @@ class DeepseekOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
if
pixel_values
is
None
or
torch
.
sum
(
pixel_values
).
item
()
==
0
:
return
None
base_size
=
self
.
vision_config
.
image_size
# Use actual tensor spatial dim instead of hardcoded
# vision_config.image_size (1024). The vision encoders (SAM & CLIP)
# support arbitrary resolutions via pos-encoding interpolation,
# so Tiny/Small/Base/Large variants all work with the same weights.
base_size
=
pixel_values
.
shape
[
-
1
]
if
images_crop
is
not
None
and
images_crop
.
numel
()
>
0
:
image_size
=
images_crop
.
shape
[
-
1
]
else
:
image_size
=
base_size
return
DeepseekOCRImagePixelInputs
(
type
=
"pixel_values"
,
data
=
pixel_values
,
...
...
@@ -456,6 +465,7 @@ class DeepseekOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
images_spatial_crop
=
images_spatial_crop
,
resolve_bindings
=
{
"base_size"
:
base_size
,
"image_size"
:
image_size
,
},
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment