Skip to content

Bump transformers to 5.0.0#4060

Open
AlexanderDokuchaev wants to merge 9 commits into
openvinotoolkit:developfrom
AlexanderDokuchaev:ad/bump_transformers
Open

Bump transformers to 5.0.0#4060
AlexanderDokuchaev wants to merge 9 commits into
openvinotoolkit:developfrom
AlexanderDokuchaev:ad/bump_transformers

Conversation

@AlexanderDokuchaev

@AlexanderDokuchaev AlexanderDokuchaev commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Changes

Bump transformers to 5.0.0

  • apply_chat_template returns BatchFeature instance instead of dict
  • Install eval_llm with [hf] to install all requaread packages
  • Removed StaticCacheConfig
  • Updated WWB fork
  • Removed dummy_llama tests for SparsityActivation alogrimth as it falls

Reason for changes

Related tickets

Tests

Test examples - success
Weight compression - success
PTQ-873

@github-actions github-actions Bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF PTQ Pull requests that updates NNCF PTQ labels May 1, 2026
@AlexanderDokuchaev AlexanderDokuchaev changed the title Bump transformers to 5.0.0rc3 Bump transformers to 5.0.0 Jun 17, 2026
@AlexanderDokuchaev AlexanderDokuchaev marked this pull request as ready for review June 17, 2026 11:23
@AlexanderDokuchaev AlexanderDokuchaev requested a review from a team as a code owner June 17, 2026 11:23
Copilot AI review requested due to automatic review settings June 17, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates NNCF’s test and example environments to be compatible with transformers==5.0.0, adjusting call sites for API changes (notably apply_chat_template return type) and updating generation static-cache configuration accordingly.

Changes:

  • Bump transformers to 5.0.0 across test/example requirements and update related dependencies (e.g., sentence-transformers, tensorflow-io, whowhatbench, lm_eval[hf]).
  • Update example code to handle tokenizer.apply_chat_template(...) returning a BatchFeature (extracting input_ids explicitly).
  • Remove StaticCacheConfig usage and switch generation cache_config to a dict-based configuration; remove the dummy_llama sparsify-activations unit test helper/testcase.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/torch/requirements.txt Pins transformers==5.0.0 and updates sentence-transformers for torch test environment.
tests/torch/function_hook/sparsify_activations/test_algo.py Removes dummy_llama sparsify-activations algorithm test case.
tests/torch/function_hook/sparsify_activations/helpers.py Removes dummy_llama_model helper and related transformers import.
tests/post_training/requirements.txt Pins transformers==5.0.0, bumps tensorflow-io, updates WWB fork commit.
tests/post_training/pipelines/fx_modelling.py Drops StaticCacheConfig and updates static cache setup for Transformers 5.
tests/openvino/requirements.txt Pins transformers==5.0.0 for OpenVINO tests.
examples/llm_compression/torch/downstream_qat_with_nls/requirements.txt Pins transformers==5.0.0 and switches to lm_eval[hf].
examples/llm_compression/torch/distillation_qat_with_lora/requirements.txt Pins transformers==5.0.0 and switches to lm_eval[hf].
examples/llm_compression/torch_fx/tiny_llama/requirements.txt Pins transformers==5.0.0 for the torch.fx tiny-llama example.
examples/llm_compression/torch_fx/tiny_llama/modelling.py Updates static cache configuration to dict and ensures use_cache is enabled.
examples/llm_compression/torch_fx/tiny_llama/main.py Adjusts chat template tokenization to handle BatchFeature output.
examples/llm_compression/openvino/tiny_llama/requirements.txt Pins transformers==5.0.0 for OpenVINO tiny-llama example.
examples/llm_compression/openvino/tiny_llama/main.py Adjusts chat template tokenization to handle BatchFeature output.
examples/llm_compression/openvino/tiny_llama_synthetic_data/requirements.txt Pins transformers==5.0.0 for synthetic-data example.
examples/llm_compression/openvino/tiny_llama_find_hyperparams/requirements.txt Pins transformers==5.0.0 and updates WWB fork commit.
examples/llm_compression/openvino/smollm2_360m_fp8/requirements.txt Pins transformers==5.0.0 for FP8 example.
examples/llm_compression/openvino/smollm2_360m_fp8/main.py Adjusts chat template tokenization to handle BatchFeature output.
examples/llm_compression/openvino/smollm2_360m_codebook/requirements.txt Pins transformers==5.0.0 for codebook example.
examples/llm_compression/openvino/smollm2_360m_codebook/main.py Adjusts chat template tokenization to handle BatchFeature output.
examples/llm_compression/openvino/smollm2_360m_adaptive_codebook/requirements.txt Pins transformers==5.0.0 for adaptive codebook example.
examples/llm_compression/openvino/smollm2_360m_adaptive_codebook/main.py Adjusts chat template tokenization to handle BatchFeature output.
examples/llm_compression/onnx/tiny_llama/requirements.txt Pins transformers==5.0.0 for ONNX tiny-llama example.
examples/llm_compression/onnx/tiny_llama/main.py Adjusts chat template tokenization to handle BatchFeature output.
examples/llm_compression/onnx/tiny_llama_scale_estimation/requirements.txt Pins transformers==5.0.0 for scale-estimation example.
examples/llm_compression/onnx/tiny_llama_scale_estimation/main.py Adjusts chat template tokenization to handle BatchFeature output.

Comment thread tests/torch/function_hook/sparsify_activations/test_algo.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants