setfit
setfit copied to clipboard
Example from quick start fails with 'TrainingArguments' object has no attribute 'eval_strategy'
Tried to follow https://huggingface.co/docs/setfit/main/en/quickstart#end-to-end
This notebook is just a copypaste from quickstart: https://colab.research.google.com/drive/1N9HPmqhaqBm_rL13nTuV3wC7rdIJseve#scrollTo=0NybX59O5o98
The train fails with
/usr/local/lib/python3.10/dist-packages/transformers/utils/notebook.py in on_train_begin(self, args, state, control, **kwargs)
293
294 def on_train_begin(self, args, state, control, **kwargs):
--> 295 self.first_column = "Epoch" if args.eval_strategy == IntervalStrategy.EPOCH else "Step"
296 self.training_loss = 0
297 self.last_log = 0
AttributeError: 'TrainingArguments' object has no attribute 'eval_strategy'
The most recent version of transformers has renamed evaluation_strategy into eval_strategy. I'd recommend downgrading transformers to a slightly older version. You can see your current version with pip show transformers.
- Tom Aarsen
Thanks, I was able to fix this with !pip install transformers==4.39.0
Excellent, thanks for sharing! I intend to fix this more properly in early June.
- Tom Aarsen
It seems to work up to transformers==4.40.2, but it fails with transformers>=4.41.0, in case useful :)
I was facing this issue yesterday, I will try that particular downgrade to transformers this week. Thank you!
Hello, I am facing the same issue and downgrading to transformers==4.39.0 did not fix the problem. Neither did the workaround args.eval_strategy = args.evaluation_strategy. Are there any updates or any other insights? Thanks in advance!
The transformers downgrade worked for me
If in notebook you can run:
pip install setfit transformers==4.39.0
Yes it worked for me too now, I forgot to restart my kernel. Apologies and thanks!
+1 on this - any plans for a fix to be released?