diff --git a/keras_nlp/__init__.py b/keras_nlp/__init__.py index 050a189d6f..5717f8bcb6 100644 --- a/keras_nlp/__init__.py +++ b/keras_nlp/__init__.py @@ -12,6 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +# sentencepiece is segfaulting on tf-nightly if tensorflow is imported first. +# This is a temporary fix to restore our nightly testing to green, while we look +# for a longer term solution. +try: + import sentencepiece +except ImportError: + pass + from keras_nlp import layers from keras_nlp import metrics from keras_nlp import models