From db0831e0193d38df348b0b3ffc694b479cafb6a4 Mon Sep 17 00:00:00 2001 From: yilian49 <43861414+yilian49@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:05:27 -0400 Subject: [PATCH] Quick fix for loading processor for supporting internvl3_5 series (#9676) --- python/sglang/srt/hf_transformers_utils.py | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/python/sglang/srt/hf_transformers_utils.py b/python/sglang/srt/hf_transformers_utils.py index 4503a4598..9da66a3ec 100644 --- a/python/sglang/srt/hf_transformers_utils.py +++ b/python/sglang/srt/hf_transformers_utils.py @@ -368,13 +368,22 @@ def get_processor( if config.model_type not in {"llava", "clip"}: kwargs["use_fast"] = use_fast try: - processor = AutoProcessor.from_pretrained( - tokenizer_name, - *args, - trust_remote_code=trust_remote_code, - revision=revision, - **kwargs, - ) + if "InternVL3_5" in tokenizer_name: + processor = AutoTokenizer.from_pretrained( + tokenizer_name, + *args, + trust_remote_code=trust_remote_code, + revision=revision, + **kwargs, + ) + else: + processor = AutoProcessor.from_pretrained( + tokenizer_name, + *args, + trust_remote_code=trust_remote_code, + revision=revision, + **kwargs, + ) except ValueError as e: error_message = str(e)