Skip to content

v1.2.0

Latest

Choose a tag to compare

@tomaarsen tomaarsen released this 04 Sep 14:35
· 2 commits to main since this release

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_ratio and logging_dir were removed in transformers v5. The warmup_proportion in the SetFit TrainingArguments keeps working, as it is now passed on as a fractional warmup_steps. logging_dir is ignored with a warning, as transformers v5 reads the TENSORBOARD_LOGGING_DIR environment variable instead.
  • The integration callbacks of transformers, such as those for Trackio and Weights & Biases, started reading arguments that only exist on the transformers TrainingArguments, e.g. args.project. The SetFit TrainingArguments now 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, onnx and skl2onnx releases. torch 2.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. skl2onnx 1.20 dropped onnxconverter_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 openvino 2026, which removed the openvino.runtime module. (#647)

Minor changes

  • evaluate 0.4.6 or newer is now required, as older versions cannot load metrics with huggingface_hub v1. (#647)
  • codecarbon 2.6, 2.7 and 2.8 are excluded from the codecarbon extra. 2.6 spams the console, and 2.7 and 2.8 fail when a second tracker is started in the same process, which AbsaTrainer does. (#647)
  • The README, docs and notebooks now load datasets by their namespaced ids, e.g. stanfordnlp/sst2 instead of sst2. The old namespace-less ids no longer resolve with recent datasets and huggingface_hub releases. (#649)
  • The CI now installs dependencies with uv and, next to the regular matrix, runs the minimum supported versions and the last transformers v4 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 codecarbon 3.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

Full Changelog: v1.1.3...v1.2.0