transformers icon indicating copy to clipboard operation
transformers copied to clipboard

added warning to Trainer when label_names is not specified for PeftModel

Open MilkClouds opened this issue 7 months ago • 8 comments

What does this PR do?

in Trainer, it automatically finds label_names with input arguments name of model. But with model which is PeftModel, the input arguments are all hidden and we can't find the input argument's name automatically.

So, for the case then the user didn't specified label_names in TrainerArguments, I made warning message pop up.

p.s. it makes the change when I add call trainer.predict; if label_names it not set, there's no way I can get get label_ids from trainer.predict outcomes.

Before submitting

  • [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [ ] Did you read the contributor guideline, Pull Request section?
  • [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
  • [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [ ] Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

MilkClouds avatar Jul 19 '24 10:07 MilkClouds