Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapters-trainer: add missing preprocess_logits_for_metrics argument #317

Merged
merged 1 commit into from
Apr 6, 2022
Merged

adapters-trainer: add missing preprocess_logits_for_metrics argument #317

merged 1 commit into from
Apr 6, 2022

Conversation

stefan-it
Copy link
Contributor

Hi,

I just wanted to train my first language adapter with the run_mlm.py example script. I also used a validation corpus, but training does not start due to this error message:

Traceback (most recent call last):                                                                                                                                            
  File "run_mlm.py", line 632, in <module>                                                                                                                                    
    main()                                                                                                                                                                    
  File "run_mlm.py", line 563, in main                                                                                                                                        
    trainer = trainer_class(                                                                        
TypeError: __init__() got an unexpected keyword argument 'preprocess_logits_for_metrics'

I did some debugging and the preprocess_logits_for_metrics argument is available for the upstream Transformers Trainer interface:

https://github.com/huggingface/transformers/blob/main/src/transformers/trainer.py#L291

But is currently not available for the Adapters Trainer interface. This PR adds the preprocess_logits_for_metrics argument to the interface. Training is then working 🤗

@calpt calpt self-requested a review April 6, 2022 09:06
Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@calpt calpt merged commit 596fa72 into adapter-hub:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants