[Security] Respect user trust_remote_code setting in NemotronVL and KimiK25 (#36192)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2026-03-06 01:15:19 -05:00
committed by GitHub
parent 43f10573c9
commit 00bd08edee
2 changed files with 7 additions and 2 deletions

View File

@@ -174,7 +174,8 @@ class KimiK25ProcessingInfo(BaseProcessingInfo):
self.hf_config = self.get_hf_config()
self.media_token_id = self.hf_config.media_placeholder_token_id
media_processor = cached_get_image_processor(
self.ctx.model_config.model, trust_remote_code=True
self.ctx.model_config.model,
trust_remote_code=self.ctx.model_config.trust_remote_code,
)
self.media_processor = media_processor
self.hf_processor = MoonshotKimiVAutoProcessor(

View File

@@ -402,6 +402,7 @@ class LlamaNemotronVLChatModel(nn.Module, SupportsMultiModal, SupportsPP, Suppor
multimodal_config = vllm_config.model_config.multimodal_config
self.config = config
self.model_config = vllm_config.model_config
self.multimodal_config = multimodal_config
self._patch_quant_config(config, quant_config)
@@ -456,7 +457,10 @@ class LlamaNemotronVLChatModel(nn.Module, SupportsMultiModal, SupportsPP, Suppor
*,
prefix: str,
):
return AutoModel.from_config(config.vision_config, trust_remote_code=True)
return AutoModel.from_config(
config.vision_config,
trust_remote_code=self.model_config.trust_remote_code,
)
def _init_mlp1(
self,