Skip to content
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

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

SamanehSaadat
Copy link
Member

@SamanehSaadat SamanehSaadat commented Apr 19, 2024

This PR addresses this issue: user doesn't have tensorflow installed and doesn't expect to get error as they're using pytorch backend.

@SamanehSaadat SamanehSaadat added the kokoro:force-run Runs Tests on GPU label Apr 22, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Runs Tests on GPU label Apr 22, 2024
import tensorflow as tf
except ImportError:
raise ImportError(
"To use `keras_nlp`, please install Tensorflow: `pip install tensorflow`. "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tensorflow -> TensorFlow

except ImportError:
raise ImportError(
"To use `keras_nlp`, please install Tensorflow: `pip install tensorflow`. "
"Tensorflow package is required for data preprocessing with any backend."
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@SamanehSaadat SamanehSaadat added kokoro:force-run Runs Tests on GPU and removed kokoro:force-run Runs Tests on GPU labels Apr 22, 2024
@SamanehSaadat
Copy link
Member Author

The test failures are not related to this PR and the fix is on the way in #1593.

@SamanehSaadat SamanehSaadat merged commit 31dc244 into keras-team:master Apr 23, 2024
4 of 10 checks passed
@turgut090
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants