-
Notifications
You must be signed in to change notification settings - Fork 251
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
Improve error handling for missing TensorFlow dependency in keras_nlp. #1585
Conversation
import tensorflow as tf | ||
except ImportError: | ||
raise ImportError( | ||
"To use `keras_nlp`, please install Tensorflow: `pip install tensorflow`. " |
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.
Tensorflow -> TensorFlow
keras_nlp/utils/tensor_utils.py
Outdated
except ImportError: | ||
raise ImportError( | ||
"To use `keras_nlp`, please install Tensorflow: `pip install tensorflow`. " | ||
"Tensorflow package is required for data preprocessing with any backend." |
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.
Tensorflow package -> The TensorFlow package
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.
Done!
The test failures are not related to this PR and the fix is on the way in #1593. |
Installing keras-nlp can be quite challenging, especially for Windows users. To improve the experience, it's crucial to include precise steps and OS requirements in the readme section. Since TensorFlow text doesn't function on Windows, it's essential to address this issue upfront. |
This PR addresses this issue: user doesn't have
tensorflow
installed and doesn't expect to get error as they're usingpytorch
backend.