Adds TRANSFORMERS_TEST_DEVICE#25506
Conversation
Mirrors the same API in the diffusers library. Useful in transformers too.
|
Hi thanks, it is a good suggestion to simply try creating the device. Perhaps Doing this approach makes the list of backends obsolete, so I removed. I just let it throw an unhandled error as I feel the message is informative enough, but let me know if you want that to be caught. |
sgugger
left a comment
There was a problem hiding this comment.
Thanks for iterating! One last nit and we should be good to merge!
|
Updated the error message, let me know if it works for you~ |
sgugger
left a comment
There was a problem hiding this comment.
Thanks a lot! Can you just run make style on your branch to fix the quality issue?
ArthurZucker
left a comment
There was a problem hiding this comment.
Could you also add some documentation in testing.md to not make it hidden?
Woops, I ran this but forgot to commit the changes.
Will do 👍 where do you think the best place is this for this in the file? I should say, to all the suggested changes here, should these also be mirrored in |
|
You can probably add it to |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
|
@ArthurZucker added a small section following the "To GPU or not to GPU" section – in my head this fits well. Let me know how you feel about the language there 🤗 I ran |
ArthurZucker
left a comment
There was a problem hiding this comment.
Thanks! Just waiting for the CIs
Adds support for environment variable
TRANSFORMERS_TEST_DEVICEto set device in use for running the test suite. This pattern is already in use indiffusers.What does this PR do?
Adds support for environment variable
TRANSFORMERS_TEST_DEVICEto set device in use for running the test suite. This is a pattern already in use indiffuserswhich would be useful to have in transformers.Additionally, I would like to propose removing the check on available backends, as is found in the diffusers version. I included it here to match diffusers, but it would be useful to remove it (for example, if testing new backends and the like). Let me know if that is okay and I will amend the PR.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@sgugger, git blame says you! 🤗