Skip to content

Commit af7a156

Browse files
Fix the build for the tensorflow text
PiperOrigin-RevId: 810525790
1 parent aa839b1 commit af7a156

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

WORKSPACE

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

55
http_archive(
66
name = "icu",
7-
strip_prefix = "icu-release-64-2",
7+
build_file = "//third_party/icu:BUILD.bzl",
8+
patch_args = ["-p1"],
9+
patches = ["//third_party/icu:udata.patch"],
810
sha256 = "dfc62618aa4bd3ca14a3df548cd65fe393155edd213e49c39f3a30ccd618fc27",
11+
strip_prefix = "icu-release-64-2",
912
urls = [
1013
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/unicode-org/icu/archive/release-64-2.zip",
1114
"https://github.com/unicode-org/icu/archive/release-64-2.zip",
1215
],
13-
build_file = "//third_party/icu:BUILD.bzl",
14-
patches = ["//third_party/icu:udata.patch"],
15-
patch_args = ["-p1"],
1616
)
1717

1818
http_archive(
1919
name = "com_google_sentencepiece",
20-
strip_prefix = "sentencepiece-0.1.96",
20+
build_file = "//third_party/sentencepiece:BUILD",
21+
patch_args = ["-p1"],
22+
patches = ["//third_party/sentencepiece:sp.patch"],
2123
sha256 = "8409b0126ebd62b256c685d5757150cf7fcb2b92a2f2b98efb3f38fc36719754",
24+
strip_prefix = "sentencepiece-0.1.96",
2225
urls = [
23-
"https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip"
26+
"https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip",
2427
],
25-
build_file = "//third_party/sentencepiece:BUILD",
26-
patches = ["//third_party/sentencepiece:sp.patch"],
27-
patch_args = ["-p1"],
2828
)
2929

3030
http_archive(
3131
name = "cppitertools",
32-
urls = ["https://github.com/ryanhaining/cppitertools/archive/refs/tags/v2.0.zip"],
3332
sha256 = "e56741b108d6baced98c4ccd83fd0d5a545937f2845978799c28d0312c0dee3d",
3433
strip_prefix = "cppitertools-2.0",
34+
urls = ["https://github.com/ryanhaining/cppitertools/archive/refs/tags/v2.0.zip"],
3535
)
3636

3737
http_archive(
@@ -56,10 +56,9 @@ http_archive(
5656

5757
http_archive(
5858
name = "org_tensorflow",
59-
strip_prefix = "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a",
60-
sha256 = "5a5bc4599964c71277dcac0d687435291e5810d2ac2f6283cc96736febf73aaf",
59+
strip_prefix = "tensorflow-2.20.0",
6160
urls = [
62-
"https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a.zip"
61+
"https://github.com/tensorflow/tensorflow/archive/v2.20.0.zip",
6362
],
6463
)
6564

@@ -74,13 +73,13 @@ http_archive(
7473

7574
http_archive(
7675
name = "pybind11",
76+
build_file = "//third_party/pybind11:BUILD.bzl",
77+
sha256 = "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240",
78+
strip_prefix = "pybind11-2.13.4",
7779
urls = [
7880
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.13.4.tar.gz",
7981
"https://github.com/pybind/pybind11/archive/v2.13.4.tar.gz",
8082
],
81-
sha256 = "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240",
82-
strip_prefix = "pybind11-2.13.4",
83-
build_file = "//third_party/pybind11:BUILD.bzl",
8483
)
8584

8685
http_archive(
@@ -99,27 +98,31 @@ load("//tensorflow_text:tftext.bzl", "py_deps_profile")
9998

10099
py_deps_profile(
101100
name = "release_or_nightly",
102-
requirements_in = "//oss_scripts/pip_package:requirements.in",
103-
pip_repo_name = "pypi",
104101
deps_map = {
105-
"tensorflow": ["tf-nightly", "tf_header_lib", "libtensorflow_framework"],
106-
"tf-keras": ["tf-keras-nightly"]
102+
"tensorflow": [
103+
"tf-nightly",
104+
"tf_header_lib",
105+
"libtensorflow_framework",
106+
],
107+
"tf-keras": ["tf-keras-nightly"],
107108
},
109+
pip_repo_name = "pypi",
110+
requirements_in = "//oss_scripts/pip_package:requirements.in",
108111
switch = {
109-
"IS_NIGHTLY": "nightly"
110-
}
112+
"IS_NIGHTLY": "false",
113+
},
111114
)
112115

113116
load("@org_tensorflow//third_party/py:python_init_repositories.bzl", "python_init_repositories")
114117

115118
python_init_repositories(
119+
default_python_version = "system",
116120
requirements = {
117121
"3.9": "//oss_scripts/pip_package:requirements_lock_3_9.txt",
118122
"3.10": "//oss_scripts/pip_package:requirements_lock_3_10.txt",
119123
"3.11": "//oss_scripts/pip_package:requirements_lock_3_11.txt",
120124
"3.12": "//oss_scripts/pip_package:requirements_lock_3_12.txt",
121125
},
122-
default_python_version = "system",
123126
)
124127

125128
load("@org_tensorflow//third_party/py:python_init_toolchains.bzl", "python_init_toolchains")
@@ -136,18 +139,28 @@ install_deps()
136139

137140
# Initialize TensorFlow dependencies.
138141
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")
142+
139143
tf_workspace3()
144+
140145
load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")
146+
141147
tf_workspace2()
148+
142149
load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1")
150+
143151
tf_workspace1()
152+
144153
load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
154+
145155
tf_workspace0()
146156

147157
# Set up Android.
148158
load("@org_tensorflow//third_party/android:android_configure.bzl", "android_configure")
149-
android_configure(name="local_config_android")
159+
160+
android_configure(name = "local_config_android")
161+
150162
load("@local_config_android//:android.bzl", "android_workspace")
163+
151164
android_workspace()
152165

153166
load(

oss_scripts/pip_package/requirements.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ setuptools==70.0.0
22
dm-tree==0.1.8 # Limit for macos support.
33
numpy
44
protobuf==4.25.3 # b/397977335 - Fix crash on python 3.9, 3.10.
5-
tensorflow
6-
tf-keras
5+
tensorflow==2.20.0
6+
tf-keras<=3.11.3
77
tensorflow-datasets
88
tensorflow-metadata

tensorflow_text/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@
110110
]
111111

112112
remove_undocumented(__name__, _allowed_symbols)
113-
__version__ = "2.13.0"
113+
__version__ = "2.20.0"

0 commit comments

Comments
 (0)