Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The TensorFlow Text package requires use of a matching minor version of TensorFlow. In order to support Apple Silicon macs, Tensorflow Text chooses between the
tensorflow
andtensorflow-macos
packages automatically based on system architecture. However, I believe that commit a7e1b5b accidentally wiped out this logic. Additionally, this commit failed to increment the minor version of thetensorflow-macos
dependency.This typically isn't a problem for users installing TensorFlow Text using
pip
on non-Apple Silicon devices, sincepip
just tries to find the best set of packages for the current system. However, this is a problem for package managers like Poetry, which create a deterministic lock file allowing a similar set of dependencies to be installed across different systems, modulo any architectural differences. Since Poetry needs to resolve a combination of dependencies that will work for any system, it eagerly tries to identify a version oftensorflow-macos
that will work on Apple Silicon devices. However, since the minor versions of thetensorflow
andtensorflow-macos
dependencies don't match, it's unable to find an appropriate version ofkeras
that both can use. As a result, installingtensorflow-text (>=2.8.0)
using Poetry is currently impossible.These changes restore the logic to automatically select between
tensorflow
andtensorflow-macos
based on platform and architecture identifiers, and bump the version of thetensorflow-macos
dependency to match the minor version oftensorflow
andtensorflow-text
.