@@ -844,9 +844,10 @@ def get_max_tokens(max_crops: int, crop_patches: int, left_margin: int,
844844
845845
846846def get_max_molmo_image_tokens (ctx : InputContext ) -> int :
847- processor = cached_get_processor (ctx .model_config .model ,
848- trust_remote_code = True ,
849- revision = ctx .model_config .code_revision )
847+ processor = cached_get_processor (
848+ ctx .model_config .model ,
849+ trust_remote_code = ctx .model_config .trust_remote_code ,
850+ revision = ctx .model_config .code_revision )
850851 image_processor = processor .image_processor
851852 max_llm_image_tokens = get_max_tokens (
852853 image_processor .max_crops ,
@@ -870,9 +871,10 @@ def image_input_mapper_for_molmo(
870871
871872def dummy_data_for_molmo (ctx : InputContext , seq_len : int ,
872873 mm_counts : Mapping [str , int ]):
873- processor = cached_get_processor (ctx .model_config .model ,
874- trust_remote_code = True ,
875- revision = ctx .model_config .code_revision )
874+ processor = cached_get_processor (
875+ ctx .model_config .model ,
876+ trust_remote_code = ctx .model_config .trust_remote_code ,
877+ revision = ctx .model_config .code_revision )
876878 image_processor = processor .image_processor
877879
878880 base_image_input_d = image_processor .image_patch_size
@@ -935,11 +937,11 @@ def input_processor_for_molmo(ctx: InputContext, inputs: DecoderOnlyInputs):
935937 multi_modal_data = inputs .get ("multi_modal_data" )
936938 image = None if multi_modal_data is None else multi_modal_data .get ("image" )
937939
938- processor = cached_get_processor (ctx .model_config .model ,
939- trust_remote_code = True ,
940- revision = ctx .model_config .code_revision )
941-
942940 model_config = ctx .model_config
941+ processor = cached_get_processor (
942+ ctx .model_config .model ,
943+ trust_remote_code = model_config .trust_remote_code ,
944+ revision = ctx .model_config .code_revision )
943945 tokenizer = cached_get_tokenizer (
944946 model_config .tokenizer ,
945947 trust_remote_code = model_config .trust_remote_code )
0 commit comments