Skip to content

Update TF.Text guide and tutorial notebooks for TensorFlow 2.20+ and Keras 3. - #1577

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1009121307
Oct 30, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1009121307

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Update TF.Text guide and tutorial notebooks for TensorFlow 2.20+ and Keras 3.

Several TF.Text guide and tutorial notebooks fail on current TensorFlow releases due to outdated package pins, legacy system package workarounds, and Keras 3 API changes.

  • Unpin legacy package versions, remove obsolete apt / protobuf workarounds and leftover empty setup cells, and replace tensorflow-addons metric usage in bert_glue.ipynb with SparseCategoricalAccuracy.
  • Enable legacy Keras (TF_USE_LEGACY_KERAS=1) and install tf-keras in notebooks that depend on Keras 2 APIs, TensorFlow Hub layers, or tf-models-official.
  • Update tf.keras.utils.get_file dataset path handling (train_dir and dataset_dir) to work with both Keras 2 and Keras 3 return values, and fix a super().__init__() call in text_generation.ipynb.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@copybara-service copybara-service Bot changed the title Fix failing TF.Text guide and tutorial notebooks for TF 2.20+ and Keras 3. Update TF.Text guide and tutorial notebooks for TensorFlow 2.20+ and Keras 3. Oct 30, 2026
…Keras 3.

Several TF.Text guide and tutorial notebooks fail on current TensorFlow releases due to outdated package pins, legacy system package workarounds, and Keras 3 API changes.

- Unpin legacy package versions, remove obsolete `apt` / `protobuf` workarounds and leftover empty setup cells, and replace `tensorflow-addons` metric usage in `bert_glue.ipynb` with `SparseCategoricalAccuracy`.
- Enable legacy Keras (`TF_USE_LEGACY_KERAS=1`) and install `tf-keras` in notebooks that depend on Keras 2 APIs, TensorFlow Hub layers, or `tf-models-official`.
- Update `tf.keras.utils.get_file` dataset path handling (`train_dir` and `dataset_dir`) to work with both Keras 2 and Keras 3 return values, and fix a `super().__init__()` call in `text_generation.ipynb`.

PiperOrigin-RevId: 1010774895
@copybara-service
copybara-service Bot merged commit 3e74e03 into master Oct 30, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_1009121307 branch October 30, 2026 20:59

This branch was previously deployed

1 inactive deployment
github-pages — 3e74e038 Deployed Oct 30, 2026 by github-pages[bot] via deploy #342
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.

1 participant