-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Expectations test utils #36569
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
Expectations test utils #36569
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
My first look has the impression that this is a bit too much. I have to think it a bit more and see what we can reduce but still get the improvements we want to have. |
ArthurZucker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree a bit with @ydshieh (who is the owner 👀 ) a bit too bloated.
Happy to have a simple and explicit function to help with these issue + an updated test to show proper usage
Let me see if I can simplify it a bit. I'll fix a test with it as proper usage as well 👍 |
|
@ArthurZucker @ydshieh |
|
Hi @ivarflakstad I am wondering what's your thoughts about:
Overall, my suggestion is just to make it less abstract: just a simple class inherited a familar class ( WDYK? |
ydshieh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few nits 🙏
ydshieh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a final nits and we are good to go! Thank you
src/transformers/testing_utils.py
Outdated
| * Matching `major` (compute capability major version) gives 2 points. | ||
| * Default expectation (if present) gives 1 points. | ||
| """ | ||
| (type, major) = key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can think of another name other than type, it would be nice, as type is a built-in function.
This PR adds the concept of
Expectations, which can be used to simplify handling different expected results depending on the environment the test is running in.Addresses #36561