Skip to content

Commit 8cc8d06

Browse files
authored
Fix tensorflow-text import to not break core tensorflow functionality (#2448)
* Fix tensorflow-text import to not break core tensorflow functionality * fix tensorflow and tensorflow_text import handling * Fix tensorflow-text import to not break core tensorflow functionality
1 parent 4de2ff6 commit 8cc8d06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

keras_hub/src/utils/tensor_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212

1313
try:
1414
import tensorflow as tf
15-
import tensorflow_text as tf_text
1615
except ImportError:
1716
tf = None
17+
try:
18+
import tensorflow_text as tf_text
19+
except ImportError:
1820
tf_text = None
1921

2022

0 commit comments

Comments
 (0)