This release introduces compatibility with transformers v5, sentence-transformers v5.4 and v6, huggingface_hub v1 and datasets v4 and v5, adds official support for Python 3.13, and fixes ONNX and OpenVINO exporting with the latest releases of their dependencies. The previous generation of these dependencies remains supported, and there shouldn't be any breaking changes.
Install this version with
pip install -U setfit
Compatibility with transformers v5, Sentence Transformers v6 and huggingface_hub v1 (#647)
The most recent releases of SetFit's core dependencies had each broken something. SetFit no longer imported with transformers v5, loading any model from the Hub failed with huggingface_hub v1, every Sentence Transformers import warned about deprecated module paths with sentence-transformers v5.4+, and Trainer.evaluate crashed on the lazy columns of datasets v4. All of these are resolved, while the older versions keep working. SetFit is now tested against transformers 4.41 through 5.16, sentence-transformers 3.0 through 6.0, huggingface_hub 0.24 through 1.30 and datasets 2.15 through 5.0, on Python 3.9 through 3.13.
Some details worth knowing if you train with transformers v5:
warmup_ratioandlogging_dirwere removed intransformersv5. Thewarmup_proportionin the SetFitTrainingArgumentskeeps working, as it is now passed on as a fractionalwarmup_steps.logging_diris ignored with a warning, astransformersv5 reads theTENSORBOARD_LOGGING_DIRenvironment variable instead.- The integration callbacks of
transformers, such as those for Trackio and Weights & Biases, started reading arguments that only exist on thetransformersTrainingArguments, e.g.args.project. The SetFitTrainingArgumentsnow defers unknown attributes to the arguments of the underlying trainer, so these callbacks work out of the box.
Beyond that, report_to is now handed to the underlying Sentence Transformers trainer when it is created, rather than afterwards. Previously, part of it was silently lost, so e.g. report_to="none" still attached the CodeCarbon callback. This is a small behaviour change, but report_to is now simply honoured. Lastly, SetFitModel.from_pretrained with local_files_only=True or in offline mode works with huggingface_hub v1, which raises a different error for missing local files.
Python version support
- We've added official support for Python 3.13, which is now included in the test suite. Python 3.9 remains the minimum version. (#647)
Exporting
- ONNX exporting works again with recent
torch,onnxandskl2onnxreleases.torch2.9 made the dynamo based exporter the default, which does not support the opsets used by SetFit, so the legacy exporter is now requested explicitly.skl2onnx1.20 droppedonnxconverter_common, which the exporter relied on. The scikit-learn head is now always converted with float32 inputs, matching the float32 embeddings from the model body. (#647) - OpenVINO exporting works with
openvino2026, which removed theopenvino.runtimemodule. (#647)
Minor changes
evaluate0.4.6 or newer is now required, as older versions cannot load metrics withhuggingface_hubv1. (#647)codecarbon2.6, 2.7 and 2.8 are excluded from thecodecarbonextra. 2.6 spams the console, and 2.7 and 2.8 fail when a second tracker is started in the same process, whichAbsaTrainerdoes. (#647)- The README, docs and notebooks now load datasets by their namespaced ids, e.g.
stanfordnlp/sst2instead ofsst2. The old namespace-less ids no longer resolve with recentdatasetsandhuggingface_hubreleases. (#649) - The CI now installs dependencies with
uvand, next to the regular matrix, runs the minimum supported versions and the lasttransformersv4 based generation as separate presets. The GitHub Actions are pinned to commit SHAs and kept up to date by Dependabot. (#631, #641, #647)
Minor bug fixes
- Saving a model before training no longer fails when
codecarbon3.x is installed. The model card now skips the emissions data when the tracker cannot report it. (#647)
All Changes
- 🔒 Pin GitHub Actions to commit SHAs by @paulinebm in #631
- chore: bump doc-builder SHA for PR upload workflow by @rtrompier in #632
- Introduce compatibility with transformers v5, Sentence Transformers v6 and huggingface_hub v1 by @tomaarsen in #647
- chore: enable Dependabot weekly GitHub Actions bumps by @hf-dependantbot-rollout[bot] in #641
- Use namespaced dataset ids in README, docs and notebooks by @tomaarsen in #649
New Contributors
- @paulinebm made their first contribution in #631
Full Changelog: v1.1.3...v1.2.0