Skip to content

Commit 3533d05

Browse files
authored
update deepseek-ocr with combine_moe (#2300)
1 parent 091b12a commit 3533d05

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed
-2.7 KB
Loading

examples/transformers/inference/deepseek-ocr/run_dpsk_ocr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
trust_remote_code=True, use_safetensors=True, device_map='auto')
1313
model = model.eval()
1414

15+
model.combine_moe()
1516

1617
# prompt = "<image>\nFree OCR. "
1718
prompt = "<image>\n<|grounding|>Convert the document to markdown. "

mindtorch/_apis/npu_910a.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ def sum(input, dim, keepdim, dtype):
459459
Tensor: The tensor with summed elements.
460460
"""
461461
if ENABLE_PYBOOST:
462+
if dtype is None:
463+
dtype = input.dtype
462464
return pyboost.sum_ext_op(input, dim, keepdim, dtype)
463465
return legacy.reduce_sum(input.astype(dtype), dim, keepdim)
464466

mindtorch/_apis/npu_910b.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ def sum(input, dim, keepdim, dtype):
461461
Tensor: The tensor with summed elements.
462462
"""
463463
if ENABLE_PYBOOST:
464+
if dtype is None:
465+
dtype = input.dtype
464466
return pyboost.sum_ext_op(input, dim, keepdim, dtype)
465467
return legacy.reduce_sum(input.astype(dtype), dim, keepdim)
466468

0 commit comments

Comments
 (0)