Update processing_llava_onevision2.py

#2
by chengcz - opened
Files changed (1) hide show
  1. processing_llava_onevision2.py +7 -3
processing_llava_onevision2.py CHANGED
@@ -116,17 +116,21 @@ class LlavaOnevision2Processor:
116
  # Drop kwargs that AutoProcessor injects but downstream constructors
117
  # don't accept (e.g. _from_auto / trust_remote_code propagation).
118
  kwargs.pop("_from_auto", None)
119
- kwargs.pop("trust_remote_code", None)
120
  kwargs.pop("code_revision", None)
121
  codec_config_override = kwargs.pop("codec_config", None)
122
 
123
  # Use the SLOW Qwen2VLImageProcessor: the Fast variant has small
124
  # normalization rounding differences that change pixel_values bit-for-bit.
125
  image_processor = Qwen2VLImageProcessor.from_pretrained(
126
- pretrained_model_name_or_path, **kwargs
 
 
127
  )
128
  tokenizer = AutoTokenizer.from_pretrained(
129
- pretrained_model_name_or_path, **kwargs
 
 
130
  )
131
 
132
  # Use the bundled VideoProcessor. Try a relative import first (when
 
116
  # Drop kwargs that AutoProcessor injects but downstream constructors
117
  # don't accept (e.g. _from_auto / trust_remote_code propagation).
118
  kwargs.pop("_from_auto", None)
119
+ trust_remote_code = kwargs.pop("trust_remote_code", None)
120
  kwargs.pop("code_revision", None)
121
  codec_config_override = kwargs.pop("codec_config", None)
122
 
123
  # Use the SLOW Qwen2VLImageProcessor: the Fast variant has small
124
  # normalization rounding differences that change pixel_values bit-for-bit.
125
  image_processor = Qwen2VLImageProcessor.from_pretrained(
126
+ pretrained_model_name_or_path,
127
+ trust_remote_code = trust_remote_code,
128
+ **kwargs,
129
  )
130
  tokenizer = AutoTokenizer.from_pretrained(
131
+ pretrained_model_name_or_path,
132
+ trust_remote_code = trust_remote_code,
133
+ **kwargs,
134
  )
135
 
136
  # Use the bundled VideoProcessor. Try a relative import first (when