-
Notifications
You must be signed in to change notification settings - Fork 248
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 importing keras_nlp without tensorflow #1660
Conversation
9c60479
to
692f1d6
Compare
3cbc6f0
to
1a239bf
Compare
This change **does not** break the dependency of tensorflow for all text preprocessing, so most real world workflows will still require a tensorflow install. But this would allow running some modeling in Jax with all preprocessing done with a separately library. And most important, this will give friendly, actionable install instructions the first time something is used that requires a tensorflow install.
1a239bf
to
d1ccc73
Compare
4f3ece6
to
9178ff4
Compare
3170b02
to
ce8d8e6
Compare
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.
Thanks, Matt! Just left some questions!
import keras_nlp | ||
|
||
|
||
class NoTensorflow(unittest.TestCase): |
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.
Is this testing basic functions when TF is not installed? I'm curious to know how you make sure that TF is not installed for this test.
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.
It's in the actions.yml controlling github actions. When testing on jax and torch, as a last step we uninstall Tensorflow and run these tests.
This will give us some coverage is someone imports Tensorflow unconditionally. It should break this test.
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.
Got it! Thanks for explaining!
import keras_nlp | ||
|
||
|
||
class NoTensorflow(unittest.TestCase): |
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.
Got it! Thanks for explaining!
This change does not break the dependency of tensorflow for all text
preprocessing, so most real world workflows will still require a
tensorflow install.
But this would allow running some modeling in Jax with all preprocessing
done with a separately library.
And most important, this will give friendly, actionable install
instructions the first time something is used that requires a
tensorflow install.