Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2025-01-13 | 2.9 kB | |
v1.1.1 source code.tar.gz | 2025-01-13 | 25.2 MB | |
v1.1.1 source code.zip | 2025-01-13 | 25.3 MB | |
Totals: 3 Items | 50.5 MB | 0 |
This is a patch release with two notable fixes:
- Compatibility with
transformers
v4.45.2 is introduced; tested up to v4.48.0, including support for finetuning with ModernBERT, e.g. nomic-ai/modernbert-embed-base (see [#577]) - Prevent
report_to="none"
in the TrainingArguments from being ignored (see [#570])
Click to expand a ModernBERT training script
:::python from datasets import load_dataset from setfit import SetFitModel, Trainer, TrainingArguments # Load a dataset from the Hugging Face Hub dataset = load_dataset("sst2") # Simulate the few-shot regime by sampling 8 examples per class train_dataset = dataset["train"].select(range(200)) eval_dataset = dataset["validation"].select(range(200)) test_dataset = dataset["validation"].select(range(200, len(dataset["validation"]))) # Load a SetFit model from Hub model = SetFitModel.from_pretrained( "nomic-ai/modernbert-embed-base", labels=["negative", "positive"], ) # Train for 100 steps; log, evaluate (with 100 steps) args = TrainingArguments( batch_size=16, max_steps=100, logging_steps=10, eval_strategy="steps", eval_steps=10, eval_max_steps=100, save_total_limit=-1, ) trainer = Trainer( model=model, args=args, train_dataset=train_dataset, eval_dataset=eval_dataset, metric="accuracy", column_mapping={"sentence": "text", "label": "label"} ) # Train and evaluate trainer.train() metrics = trainer.evaluate(test_dataset) print(metrics) # {'accuracy': 0.9092261904761905} preds = model.predict(["I loved the spiderman movie!", "Pineapple on pizza is the worst 🤮"]) print(preds) # ['positive', 'negative']What's Changed
- The smallest typo fix in the guide by @JoramMillenaar in https://github.com/huggingface/setfit/pull/580
- Let server decide default repo visibility by @Wauplin in https://github.com/huggingface/setfit/pull/573
- fixed to work transformers after v4.45.2 by @DemirTonchev in https://github.com/huggingface/setfit/pull/577
- [
fix
] Prevent report_to="none" from being ignored by @tomaarsen in https://github.com/huggingface/setfit/pull/570 - [
tests
] Add 'save_strategy="no"' in tests to counteract transformers v4.48.0 bug by @tomaarsen in https://github.com/huggingface/setfit/pull/582
New Contributors
- @JoramMillenaar made their first contribution in https://github.com/huggingface/setfit/pull/580
- @DemirTonchev made their first contribution in https://github.com/huggingface/setfit/pull/577
Full Changelog: https://github.com/huggingface/setfit/compare/v1.1.0...v1.1.1