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

Conditionally import tf_text everywhere #684

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

mattdangerw
Copy link
Member

We want to allow an installation without tf-text on MacOS, as tf-text has no pypi binaries for m1 chips.

We want to allow an installation without tf-text on MacOS, as tf-text
has no pypi binaries for m1 chips.
@mattdangerw mattdangerw requested a review from fchollet January 20, 2023 03:55
@@ -236,6 +241,8 @@ def __init__(
truncate="round_robin",
**kwargs,
):
assert_tf_text_installed(self.__class__.__name__)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this surface a readable error message? Is this the only place we need to do this?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you search code, we do this in already 8 other places, this is a spot we missed. And yes, this just raises an error, utility so our language could stay consistent.

https://github.com/keras-team/keras-nlp/blob/87019700821662d33d573ce47a1348f44418aa5a/keras_nlp/utils/tf_utils.py#L69-L75

Copy link
Contributor

@jbischof jbischof left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattdangerw mattdangerw merged commit 3cfdeb6 into keras-team:master Jan 23, 2023
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.

2 participants