vllm.transformers_utils.processor
¶
Classes:
-
HashableDict–A dictionary that can be hashed by lru_cache.
-
HashableList–A list that can be hashed by lru_cache.
Functions:
-
get_feature_extractor–Load an audio feature extractor for the given model name
-
get_image_processor–Load an image processor for the given model name via HuggingFace.
-
get_processor–Load a processor for the given model name via HuggingFace.
-
get_video_processor–Load a video processor for the given model name via HuggingFace.
HashableDict
¶
Bases: dict
A dictionary that can be hashed by lru_cache.
Source code in vllm/transformers_utils/processor.py
HashableList
¶
_transformers_v4_compatibility_import()
¶
Some remote code processors still import ChatTemplateLoadKwargs which was a
subset of ProcessorChatTemplateKwargs as defined in Transformers v4.
In Transformers v5 these were merged into ProcessorChatTemplateKwargs and
ChatTemplateLoadKwargs was removed. For backward compatibility, we add an alias
for ChatTemplateLoadKwargs if it doesn't exist.
Source code in vllm/transformers_utils/processor.py
_transformers_v4_compatibility_init()
¶
Some remote code processors may define optional_attributes in their
ProcessorMixin subclass, and then pass these arbitrary attributes directly to
ProcessorMixin.__init__, which is no longer allowed in Transformers v5. For
backward compatibility, we intercept these optional attributes and set them on the
processor instance before calling the original ProcessorMixin.__init__.
This can be removed if Molmo2ForConditionalGeneration is upstreamed to
Transformers.
Source code in vllm/transformers_utils/processor.py
get_feature_extractor(processor_name, *args, revision=None, trust_remote_code=False, **kwargs)
¶
Load an audio feature extractor for the given model name via HuggingFace.
Source code in vllm/transformers_utils/processor.py
get_image_processor(processor_name, *args, revision=None, trust_remote_code=False, processor_cls_overrides=None, **kwargs)
¶
Load an image processor for the given model name via HuggingFace.
Source code in vllm/transformers_utils/processor.py
get_processor(processor_name, *args, revision=None, trust_remote_code=False, processor_cls=ProcessorMixin, **kwargs)
¶
Load a processor for the given model name via HuggingFace.
Source code in vllm/transformers_utils/processor.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
get_video_processor(processor_name, *args, revision=None, trust_remote_code=False, processor_cls_overrides=None, **kwargs)
¶
Load a video processor for the given model name via HuggingFace.