-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Allow users to force TF availability #18650
Conversation
The documentation is not available anymore as the PR was closed or merged. |
@@ -42,6 +42,8 @@ | |||
USE_TORCH = os.environ.get("USE_TORCH", "AUTO").upper() | |||
USE_JAX = os.environ.get("USE_FLAX", "AUTO").upper() | |||
|
|||
FORCE_TF_AVAILABLE = os.environ.get("USE_TF", "AUTO").upper() |
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.
should be FORCE_TF_AVAILABLE
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.
Agreed with @kevint324, I'd put this is a FORCE_TF_AVAILABLE
env var :)
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.
Agh, typo, I'm sorry! That's definitely more than a nit!
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.
Looks good! Only left a nit
@@ -42,6 +42,8 @@ | |||
USE_TORCH = os.environ.get("USE_TORCH", "AUTO").upper() | |||
USE_JAX = os.environ.get("USE_FLAX", "AUTO").upper() | |||
|
|||
FORCE_TF_AVAILABLE = os.environ.get("USE_TF", "AUTO").upper() |
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.
Agreed with @kevint324, I'd put this is a FORCE_TF_AVAILABLE
env var :)
Ah, additional nit: I'd document this somewhere. |
62f5bfb
to
6adab4b
Compare
@LysandreJik I think a lot of these envvars aren't documented anywhere - I can't see any documentation for USE_TF or USE_TORCH! Maybe we should make a separate docs PR with a list of envvars that |
That would be fantastic :) Thanks for your contribution, merging! |
* Allow users to force TF availability * Correctly name the envvar!
We have a user report that with custom Tensorflow builds and package names that
_tf_available
can returnFalse
even ifimport tensorflow
succeeds, because the user's package name isn't in the allowed list.This is quite niche, so I don't want to do anything that could affect other users and workflows, but I added a
FORCE_TF_AVAILABLE
envvar that will skip version checks and just make sure TF is treated as available. @sgugger WDYT, or is there a better solution?Fixed #18642