diff --git a/vllm/model_executor/models/llava_onevision2.py b/vllm/model_executor/models/llava_onevision2.py index c09b477f53..f094a168fb 100644 --- a/vllm/model_executor/models/llava_onevision2.py +++ b/vllm/model_executor/models/llava_onevision2.py @@ -39,7 +39,10 @@ import torch.nn as nn import torch.nn.functional as F from PIL import Image from transformers import AutoProcessor, AutoTokenizer, BatchFeature -from transformers.dynamic_module_utils import get_class_from_dynamic_module +from transformers.dynamic_module_utils import ( + get_class_from_dynamic_module, + resolve_trust_remote_code, +) from transformers.models.qwen2_vl import Qwen2VLImageProcessor from transformers.models.qwen2_vl.image_processing_qwen2_vl import smart_resize @@ -129,17 +132,22 @@ def _load_ov2_processor( path = convert_model_repo_to_path(model) revision = revision or "main" + resolve_trust_remote_code( + trust_remote_code, + model, + has_local_code=False, + has_remote_code=True, + ) + processor_cls = get_class_from_dynamic_module( "processing_llava_onevision2.LlavaOnevision2Processor", path, revision=revision, - trust_remote_code=trust_remote_code, ) video_processor_cls = get_class_from_dynamic_module( "video_processing_llava_onevision2.LlavaOnevision2VideoProcessor", path, revision=revision, - trust_remote_code=trust_remote_code, ) # Slow Qwen2VLImageProcessor mirrors the remote processor (the Fast variant