Skip to content

Commit a1f794f

Browse files
russellbliuchenbing
authored andcommitted
[Security] Respect user trust_remote_code setting in NemotronVL and KimiK25 (vllm-project#36192)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
1 parent ad41009 commit a1f794f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

vllm/model_executor/models/kimi_k25.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ def __init__(self, ctx: InputProcessingContext) -> None:
174174
self.hf_config = self.get_hf_config()
175175
self.media_token_id = self.hf_config.media_placeholder_token_id
176176
media_processor = cached_get_image_processor(
177-
self.ctx.model_config.model, trust_remote_code=True
177+
self.ctx.model_config.model,
178+
trust_remote_code=self.ctx.model_config.trust_remote_code,
178179
)
179180
self.media_processor = media_processor
180181
self.hf_processor = MoonshotKimiVAutoProcessor(

vllm/model_executor/models/nemotron_vl.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = "") -> None:
402402
multimodal_config = vllm_config.model_config.multimodal_config
403403

404404
self.config = config
405+
self.model_config = vllm_config.model_config
405406
self.multimodal_config = multimodal_config
406407
self._patch_quant_config(config, quant_config)
407408

@@ -456,7 +457,10 @@ def _init_vision_model(
456457
*,
457458
prefix: str,
458459
):
459-
return AutoModel.from_config(config.vision_config, trust_remote_code=True)
460+
return AutoModel.from_config(
461+
config.vision_config,
462+
trust_remote_code=self.model_config.trust_remote_code,
463+
)
460464

461465
def _init_mlp1(
462466
self,

0 commit comments

Comments
 (0)