[XPU] Fix DeepSeek-OCR tests under transformers 5.x (#23044)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Ma Mingfei <mingfei.ma@intel.com>
This commit is contained in:
Xinyuan Tong
2026-04-21 14:57:56 +08:00
committed by GitHub
co-authored by Claude Opus 4.7 Ma Mingfei
parent c122d343ad
commit f63def8510
2 changed files with 4 additions and 8 deletions
+2 -4
View File
@@ -9,9 +9,9 @@ import unittest
from pathlib import Path
import requests
from transformers import AutoTokenizer
from sglang.srt.utils import kill_process_tree
from sglang.srt.utils.hf_transformers import get_tokenizer
from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
@@ -38,9 +38,7 @@ class TestDeepSeekOCR(CustomTestCase):
def setUpClass(cls):
cls._cleanup_xpu_memory()
cls.model = "deepseek-ai/DeepSeek-OCR"
cls.tokenizer = AutoTokenizer.from_pretrained(
cls.model, use_fast=False, trust_remote_code=True
)
cls.tokenizer = get_tokenizer(cls.model)
cls.base_url = DEFAULT_URL_FOR_TEST
cls.image_path = str(
(Path(__file__).resolve().parents[3] / "examples/assets/example_image.png")
+2 -4
View File
@@ -7,8 +7,8 @@ import unittest
from pathlib import Path
import test_deepseek_ocr as deepseek_ocr
from transformers import AutoTokenizer
from sglang.srt.utils.hf_transformers import get_tokenizer
from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
@@ -21,9 +21,7 @@ class TestDeepSeekOCRTriton(deepseek_ocr.TestDeepSeekOCR):
def setUpClass(cls):
cls._cleanup_xpu_memory()
cls.model = "deepseek-ai/DeepSeek-OCR"
cls.tokenizer = AutoTokenizer.from_pretrained(
cls.model, use_fast=False, trust_remote_code=True
)
cls.tokenizer = get_tokenizer(cls.model)
cls.base_url = DEFAULT_URL_FOR_TEST
cls.image_path = str(
(Path(__file__).resolve().parents[3] / "examples/assets/example_image.png")