Auto Transformers Version For Model Export#1827
Open
apaniukov wants to merge 2 commits into
Open
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. |
rkazants
reviewed
Jun 25, 2026
| [--quantization-statistics-path QUANTIZATION_STATISTICS_PATH] | ||
| [--num-samples NUM_SAMPLES] [--disable-stateful] [--disable-convert-tokenizer] | ||
| [--smooth-quant-alpha SMOOTH_QUANT_ALPHA] | ||
| [--transformers-version TRANSFORMERS_VERSION] |
Collaborator
There was a problem hiding this comment.
remove this new option. let us have it OOB to be working
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add
--transformers-versiontooptimum-cli export openvino.Different models need different transformers versions to export (some newer than optimum-intel's <5.1 pin). Today users must manually
pip install transformers==Xper model. This adds a flag that switches transformers on the fly in an ephemeral uv environment, leaving the user's env untouched:When a switch is needed, the command re-execs under
uv run --active --with transformers==<X>, overlaying only transformers on the existing venv (torch/openvino reused, ~3–5s). With no switch needed, uv is never invoked.autoresolution:MIN/MAX_TRANSFORMERS_VERSIONfrom the OpenVINO export config;"transformers_version"in the model'sconfig.jsonfor unknown architectures;Robustness: uv's overlay precedence is non-monotonic (0.8.0–0.8.3 silently ignore it), so the re-exec'd process re-verifies the active version actually satisfies the requirement and errors clearly otherwise. Adds a
transformers-switchextra pinned to uv>=0.8.4.Changes:
transformers_version.py(version resolution + re-exec);--transformers-versionflag inopenvino.py;transformers-switchextra insetup.py;Usage example
🤖 Generated with Claude Code
Fixes # (issue)
Before submitting