setfit icon indicating copy to clipboard operation
setfit copied to clipboard

Usage of deprecated `evaluation_strategy` in TrainingArguments

Open B-Step62 opened this issue 10 months ago • 1 comments

Hi team!

The attribute evaluation_strategy is being deprecated in the main branch in the Transformers repository (https://github.com/huggingface/transformers/pull/30190). The usage of evaluation_strategy in this repository should be replaced with the new eval_strategy otherwise cause error in a few places like this:

    def on_step_end(self, args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs):
        # Log
        if state.global_step == 1 and args.logging_first_step:
            control.should_log = True
        if args.logging_strategy == IntervalStrategy.STEPS and state.global_step % state.logging_steps == 0:
            control.should_log = True
    
        # Evaluate
        if (
>           args.eval_strategy == IntervalStrategy.STEPS
            and state.global_step % state.eval_steps == 0
            and args.eval_delay <= state.global_step
        ):
E       AttributeError: 'TrainingArguments' object has no attribute 'eval_strategy'

I saw the author already created PRs to a few HuggingFace repositories like trl, peft, but setfit is not in the list now, so opening an issue as a heads-up. Please feel free to close if it is already tracked somewhere else. Thank you.

B-Step62 avatar Apr 22 '24 04:04 B-Step62

A simple workaround for anyone wondering:

args.eval_strategy = args.evaluation_strategy

n-splv avatar May 18 '24 07:05 n-splv