mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 20:45:15 +08:00
[Bugfix] Properly propagate trust_remote_code settings (#10047)
Signed-off-by: Zifei Tong <zifeitong@gmail.com>
This commit is contained in:
parent
ca9844b340
commit
43300bd98a
@ -54,8 +54,9 @@ def mm_input_mapper_for_glmv(
|
|||||||
data: MultiModalData[object],
|
data: MultiModalData[object],
|
||||||
) -> Dict:
|
) -> Dict:
|
||||||
model_config = ctx.model_config
|
model_config = ctx.model_config
|
||||||
tokenizer = cached_get_tokenizer(model_config.tokenizer,
|
tokenizer = cached_get_tokenizer(
|
||||||
trust_remote_code=True)
|
model_config.tokenizer,
|
||||||
|
trust_remote_code=model_config.trust_remote_code)
|
||||||
if tokenizer is None:
|
if tokenizer is None:
|
||||||
raise RuntimeError("No HuggingFace processor is available "
|
raise RuntimeError("No HuggingFace processor is available "
|
||||||
"to process the image object")
|
"to process the image object")
|
||||||
|
|||||||
@ -844,8 +844,9 @@ def get_max_tokens(max_crops: int, crop_patches: int, left_margin: int,
|
|||||||
|
|
||||||
|
|
||||||
def get_max_molmo_image_tokens(ctx: InputContext) -> int:
|
def get_max_molmo_image_tokens(ctx: InputContext) -> int:
|
||||||
processor = cached_get_processor(ctx.model_config.model,
|
processor = cached_get_processor(
|
||||||
trust_remote_code=True,
|
ctx.model_config.model,
|
||||||
|
trust_remote_code=ctx.model_config.trust_remote_code,
|
||||||
revision=ctx.model_config.code_revision)
|
revision=ctx.model_config.code_revision)
|
||||||
image_processor = processor.image_processor
|
image_processor = processor.image_processor
|
||||||
max_llm_image_tokens = get_max_tokens(
|
max_llm_image_tokens = get_max_tokens(
|
||||||
@ -870,8 +871,9 @@ def image_input_mapper_for_molmo(
|
|||||||
|
|
||||||
def dummy_data_for_molmo(ctx: InputContext, seq_len: int,
|
def dummy_data_for_molmo(ctx: InputContext, seq_len: int,
|
||||||
mm_counts: Mapping[str, int]):
|
mm_counts: Mapping[str, int]):
|
||||||
processor = cached_get_processor(ctx.model_config.model,
|
processor = cached_get_processor(
|
||||||
trust_remote_code=True,
|
ctx.model_config.model,
|
||||||
|
trust_remote_code=ctx.model_config.trust_remote_code,
|
||||||
revision=ctx.model_config.code_revision)
|
revision=ctx.model_config.code_revision)
|
||||||
image_processor = processor.image_processor
|
image_processor = processor.image_processor
|
||||||
|
|
||||||
@ -935,11 +937,11 @@ def input_processor_for_molmo(ctx: InputContext, inputs: DecoderOnlyInputs):
|
|||||||
multi_modal_data = inputs.get("multi_modal_data")
|
multi_modal_data = inputs.get("multi_modal_data")
|
||||||
image = None if multi_modal_data is None else multi_modal_data.get("image")
|
image = None if multi_modal_data is None else multi_modal_data.get("image")
|
||||||
|
|
||||||
processor = cached_get_processor(ctx.model_config.model,
|
|
||||||
trust_remote_code=True,
|
|
||||||
revision=ctx.model_config.code_revision)
|
|
||||||
|
|
||||||
model_config = ctx.model_config
|
model_config = ctx.model_config
|
||||||
|
processor = cached_get_processor(
|
||||||
|
ctx.model_config.model,
|
||||||
|
trust_remote_code=model_config.trust_remote_code,
|
||||||
|
revision=ctx.model_config.code_revision)
|
||||||
tokenizer = cached_get_tokenizer(
|
tokenizer = cached_get_tokenizer(
|
||||||
model_config.tokenizer,
|
model_config.tokenizer,
|
||||||
trust_remote_code=model_config.trust_remote_code)
|
trust_remote_code=model_config.trust_remote_code)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user