From f2093d5a5d36f3448c4c5a20c5903596af95324b Mon Sep 17 00:00:00 2001 From: Abheesht Sharma Date: Wed, 19 Feb 2025 04:45:37 +0530 Subject: [PATCH 1/3] Move TF Text to optional dep --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6495f56bf5..0b282d356f 100644 --- a/setup.py +++ b/setup.py @@ -45,13 +45,15 @@ def get_version(rel_path): "regex", "rich", "kagglehub", - "tensorflow-text", ], extras_require={ "extras": [ "rouge-score", "sentencepiece", ], + "nlp": [ + "tensorflow-text" + ] }, # Supported Python versions python_requires=">=3.9", From a8cc05c292be3b06486ea271a06d1853921e6696 Mon Sep 17 00:00:00 2001 From: Abheesht Sharma Date: Wed, 19 Feb 2025 04:52:13 +0530 Subject: [PATCH 2/3] Add message in README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 4a5aa35899..37870a237d 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,13 @@ To install the latest KerasHub release with Keras 3, simply run: pip install --upgrade keras-hub ``` +Our text tokenizers are based on TensorFlow Text. Hence, if you are using any +model which has language as a modality, you will have to run: + +``` +pip install --upgrade keras-hub[nlp] +``` + To install the latest nightly changes for both KerasHub and Keras, you can use our nightly package. From cca184d9c3e12ca0d3c32ea39fd3d4e332fcfb6f Mon Sep 17 00:00:00 2001 From: Abheesht Sharma Date: Wed, 19 Feb 2025 04:52:48 +0530 Subject: [PATCH 3/3] Format --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0b282d356f..b9f1588039 100644 --- a/setup.py +++ b/setup.py @@ -51,9 +51,7 @@ def get_version(rel_path): "rouge-score", "sentencepiece", ], - "nlp": [ - "tensorflow-text" - ] + "nlp": ["tensorflow-text"], }, # Supported Python versions python_requires=">=3.9",