Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| TasksManager._CUSTOM_CLASSES[("pt", "idefics3", "image-text-to-text")] = ( | ||
| "transformers", | ||
| "AutoModelForImageTextToText", | ||
| ) | ||
| TasksManager._CUSTOM_CLASSES[("pt", "smolvlm", "image-text-to-text")] = ( | ||
| "transformers", | ||
| "AutoModelForImageTextToText", | ||
| ) |
There was a problem hiding this comment.
redundant ("image-text-to-text" -> AutoModelForImageTextToText) so removing https://github.com/huggingface/optimum/blob/114647f51404f9747410afc287a8079f1f16389b/optimum/exporters/tasks.py#L157
8fd0cdb to
a33065e
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds compatibility with transformers v5 across the OpenVINO Intel integration, updating model patchers, test suites, pipeline utilities, and model configs to handle the API changes introduced in transformers v5. It also deprecates support for architectures with remote modeling code incompatible with v5.
Changes:
- Deprecates/gates ~20 architectures (codegen2, exaone, decilm, internlm2, etc.) behind
is_transformers_version("<", "5")conditions in test files and model configs - Updates model patchers and utility code to handle transformers v5 API changes (renamed
infer_framework_load_model→load_model,DynamicCache.from_legacy_cache→DynamicCache(...), return value changes, etc.) - Updates
setup.pyto widen the transformers version range from<4.58to<5.1and pinoptimum-onnxto thetransformers-v5branch
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
setup.py |
Widens transformers version bound to <5.1, pins optimum-onnx to @transformers-v5 branch |
optimum/intel/pipelines/accelerator_utils.py |
Handles v5 API change: renamed pipeline function and changed return value |
optimum/exporters/openvino/model_patcher.py |
Updates cache conversion logic for v5, adds postprocess_past_key_values helper |
optimum/exporters/openvino/model_configs.py |
Adds MAX_TRANSFORMERS_VERSION = "4.57.6" to unsupported architectures; refactors init_model_configs |
optimum/intel/openvino/modeling_base.py |
Guards _get_non_default_generation_parameters call behind < "5" check |
optimum/intel/openvino/modeling_seq2seq.py |
Updates auto_model_class to use version-gated transformers_auto_class |
optimum/intel/utils/import_utils.py |
Adds is_huggingface_hub_version helper |
optimum/intel/utils/modeling_utils.py |
Replaces deprecated HfFolder().get_token() with get_token() |
tests/openvino/test_decoder.py |
Gates v5-incompatible architectures; updates comparison operators |
tests/openvino/test_seq2seq.py |
Gates v5-incompatible models; replaces deprecated APIs |
tests/openvino/test_modeling.py |
Updates image preprocessor and tokenizer API usage |
tests/openvino/test_quantization.py |
Updates expected node counts for v5; gates incompatible architectures |
tests/openvino/test_genai.py |
Removes v5-incompatible architectures from test scope |
tests/openvino/test_diffusion.py |
Conditionally includes stable-diffusion-3 based on version |
tests/openvino/test_exporters_cli.py |
Adjusts expected counts and gates architectures for v5 |
.github/workflows/*.yml |
Adds transformers version matrix and diffusers installation steps |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
with huggingface/optimum#2408
List of architectures for which are deprecating support for transformers < v5
(remote code modeling incompatible with v5)
(remote code models)
List of architectures for which we removed support for transformers < v5 for which support can be added later on
granitemoeeagle3llavagemma3