Skip to content

Relax TensorFlow constraints and update text#2630

Open
pctablet505 wants to merge 1 commit intokeras-team:masterfrom
pctablet505:tf-version-update
Open

Relax TensorFlow constraints and update text#2630
pctablet505 wants to merge 1 commit intokeras-team:masterfrom
pctablet505:tf-version-update

Conversation

@pctablet505
Copy link
Collaborator

@pctablet505 pctablet505 commented Mar 11, 2026

This pull request updates the TensorFlow and TensorFlow Text dependencies in the requirements files for JAX, Torch, and TensorFlow CUDA environments. The main goal is to ensure compatibility with newer versions of TensorFlow Text and to remove version pinning from TensorFlow packages.

Dependency updates:

  • Updated tensorflow-cpu and tensorflow[and-cuda] to remove the version pin (~=2.19), allowing installation of the latest compatible versions. (requirements-jax-cuda.txt, requirements-tensorflow-cuda.txt, requirements-torch-cuda.txt) [1] [2] [3]
  • Increased the minimum version of tensorflow-text to 2.20.1 to ensure compatibility with newer TensorFlow versions. (requirements-jax-cuda.txt, requirements-tensorflow-cuda.txt, requirements-torch-cuda.txt) [1] [2] [3]

Description of the change

tf-text>=2.20.1 required as 2.20 has broken tokenizer which we can't use.

Remove strict ~=2.19 pins for tensorflow/tensorflow-cpu (and for tensorflow[and-cuda]) and replace tensorflow-text~=2.19 with tensorflow-text>=2.20.1. Applied to requirements-jax-cuda.txt, requirements-tensorflow-cuda.txt, requirements-torch-cuda.txt, and requirements.txt to allow newer TF releases and ensure tensorflow-text compatibility; platform-specific markers and PyTorch index URLs are preserved.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modifies the dependency constraints for TensorFlow and TensorFlow-text in several requirements files. It removes the strict version pinning for TensorFlow and updates the tensorflow-text dependency to a minimum version of 2.20.1 to avoid a known issue. This change allows for greater flexibility in TensorFlow versions and ensures compatibility with the specified tensorflow-text version.

Highlights

  • TensorFlow Constraints: Relaxed strict version pinning for TensorFlow and TensorFlow-CPU in multiple requirements files.
  • TensorFlow Text Update: Updated tensorflow-text dependency to >=2.20.1 to address a broken tokenizer issue in version 2.20.
  • Compatibility: Ensured compatibility with newer TensorFlow releases across different configurations (CPU, CUDA, Torch).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • dependencies
    • Relaxed TensorFlow version constraints.
    • Updated tensorflow-text dependency to >=2.20.1.
Activity
  • The PR author, pctablet505, has addressed a broken tokenizer issue by updating the tensorflow-text dependency.
  • The changes affect multiple requirements files to ensure consistency across different environments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TensorFlow and TensorFlow-text dependencies across several requirement files. The update to tensorflow-text is well-justified by the need to avoid a broken version. However, completely removing the version pins for TensorFlow, while intended to relax constraints, introduces a significant risk of future build failures and unexpected behavior when new, incompatible versions are released. My feedback focuses on mitigating this risk by suggesting the use of minimum version specifiers. This approach maintains a baseline of compatibility while still allowing the use of newer TensorFlow releases, striking a balance between flexibility and stability.

Note: Security Review has been skipped due to the limited scope of the PR.

# Tensorflow cpu-only version.
tensorflow-cpu~=2.19
tensorflow-text~=2.19
tensorflow-cpu
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Removing the version pin for tensorflow-cpu entirely makes the dependency resolution fragile. To prevent potential future breakages with new TensorFlow releases, I recommend setting a minimum version.

tensorflow-cpu>=2.19

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tf-text>=2.20.1 automatically ensures minimum version of tensorflow >=2.20

@kokoro-team kokoro-team removed the kokoro:force-run Runs Tests on GPU label Mar 11, 2026
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