[Model] Add PaddleOCR-VL Model Support (#12953)

Co-authored-by: luoyuan.luo <luoyuan.luo@antgroup.com>
This commit is contained in:
yudian0504
2025-12-09 10:16:02 -08:00
committed by GitHub
co-authored by luoyuan.luo
parent ab0048793c
commit 9496f12d00
6 changed files with 806 additions and 6 deletions
+4 -1
View File
@@ -1702,7 +1702,10 @@ class MRotaryEmbedding(RotaryEmbedding):
torch.arange(text_len).view(1, -1).expand(3, -1) + st_idx
)
if model_type == "qwen2_5_vl":
if model_type in (
"qwen2_5_vl",
"paddleocr_vl",
):
range_tensor = torch.arange(llm_grid_t).view(-1, 1)
expanded_range = range_tensor.expand(
-1, llm_grid_h * llm_grid_w