-
Notifications
You must be signed in to change notification settings - Fork 28.8k
EvalPrediction does not allow for "sources" parameter which "sari" metric requires #15966
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
Comments
I've placed a similar request to this (I would say is the same :)), not sure if it is released. @mariosasko your advise on this? |
I saw this! I think it's fixed in the datasets library but isn't fixed yet in this one. |
Hey! We're happy to review PRs if any of you want to try your hand at contributing! |
I might be interested in contributing, but I would have quite a few questions first. I looked at the code, and seems like transformers/src/transformers/trainer is one of the main files that calls My goal is to have a variable |
I've partially make it work with my code with the following changes, but more work is needed to actually have a solution in production since it depends on a lot of code. Adding the inputs to
Then to file
And more work has to be done in the
I hope it helps with the refactoring :) |
cc @sgugger |
I don't really understand the changes you suggest @lmvasque since they use a variable Note that a line such as
can't be accepted, since it's super specific to a model (not all models have |
Thanks for reviewing this @sgugger. Yes, I've just realized that this code is executed only when running on GPU. I had the chance to run it in this setting this week and yes, you are right about the changes you mention. I've added all my changes as a pull request so you can easily review them (please use them as a reference not as a ready to go feature): #16461 About these changes:
|
I had not realized you were adding a field to the |
Can this be supported otherwise? Research in Text Simplification uses the inputs in its main evaluation metric SARI, so we cannot use Huggingface pipeline (Datasets + Transformers) for our models (unless we hack the code for our purposes..). |
I'll look into adding something that would be backward compatible and does the same as your PR, but it might take a bit of time. In the meantime, I'd advise using a subclass of the |
That's sounds good, I'm happy to do that meanwhile. Thanks again for this! It would be a good step for the Simplification world :) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
I think this can be closed now, since your PR was merged @lmvasque |
Thanks everyone! Closing. |
For everyone to use the latest version of Transformer (>=v.4.21.0 (https://newreleases.io/project/github/huggingface/transformers/release/v4.21.0) simply define:
Then in the
Thank all guys above here. Cheers! |
transformers/src/transformers/trainer_utils.py
Line 67 in db7d6a8
Hello, I have been following this example and would like to use the sari metric, which requires sources in addition to predictions and references.
Would it be possible to modify this to allow passing in source utterances so that the compute_metrics parameter can successfully pass the appropriate information to my custom compute_metrics function? Thanks!
The text was updated successfully, but these errors were encountered: