Skip to content

Commit e98d0d2

Browse files
cantoniostf-text-github-robot
authored andcommittedMar 7, 2025·
Add numpy py dep and fix python dependencies.
PiperOrigin-RevId: 734547203
1 parent 6dfa967 commit e98d0d2

File tree

12 files changed

+230
-231
lines changed

12 files changed

+230
-231
lines changed
 

‎docs/api_docs/python/text/_api_cache.json

+183-183
Large diffs are not rendered by default.

‎docs/tutorials/BUILD

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tf_org_notebook_test(
1919
tags = ["requires-net:external"],
2020
deps = [
2121
"//third_party/py/matplotlib",
22-
# numpy dep,
22+
"@pypi//numpy:pkg",
2323
# tensorflow datasets dep,
2424
],
2525
)
@@ -39,7 +39,7 @@ tf_org_notebook_test(
3939
tags = ["requires-net:external"],
4040
deps = [
4141
"//third_party/py/matplotlib",
42-
# numpy dep,
42+
"@pypi//numpy:pkg",
4343
# tensorflow datasets dep,
4444
"//third_party/py/tensorflow_text",
4545
],
@@ -52,7 +52,7 @@ tf_org_notebook_test(
5252
tags = ["requires-net:external"],
5353
deps = [
5454
"//third_party/py/matplotlib",
55-
# numpy dep,
55+
"@pypi//numpy:pkg",
5656
# tensorflow datasets dep,
5757
],
5858
)

‎docs/tutorials/uncertainty_quantification_with_sngp_bert.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@
705705
"timestamp": 1622128463249
706706
},
707707
{
708-
"file_id": "/piper/depot/google3/third_party/tensorflow_text/g3doc/tutorials/uncertainty_quantification_with_sngp_bert.ipynb?workspaceId=markdaoust:no-nightly::citc",
708+
"file_id": "/tensorflow_text/g3doc/tutorials/uncertainty_quantification_with_sngp_bert.ipynb?workspaceId=markdaoust:no-nightly::citc",
709709
"timestamp": 1622127860630
710710
}
711711
],

‎oss_scripts/pip_package/requirements.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
setuptools==70.0.0
22
dm-tree==0.1.8 # Limit for macos support.
3+
numpy
34
protobuf==4.25.3 # b/397977335 - Fix crash on python 3.9, 3.10.
45
tensorflow
56
tf-keras

‎tensorflow_text/BUILD

+29-29
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ py_test(
199199
srcs = ["python/ops/boise_offset_converter_test.py"],
200200
deps = [
201201
":tensorflow_text",
202-
# tensorflow package dep,
202+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
203203
# python/platform:client_testlib tensorflow dep,
204204
],
205205
)
@@ -225,7 +225,7 @@ py_test(
225225
srcs = ["python/ops/byte_splitter_test.py"],
226226
deps = [
227227
":tensorflow_text",
228-
# tensorflow package dep,
228+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
229229
# python/platform:client_testlib tensorflow dep,
230230
],
231231
)
@@ -300,7 +300,7 @@ py_test(
300300
deps = [
301301
":tensorflow_text",
302302
"@absl_py//absl/testing:parameterized",
303-
# tensorflow package dep,
303+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
304304
# python/compat tensorflow dep,
305305
# python/data/kernel_tests:test_base tensorflow dep,
306306
# python/framework:dtypes tensorflow dep,
@@ -337,7 +337,7 @@ py_test(
337337
deps = [
338338
":tensorflow_text",
339339
"@absl_py//absl/testing:parameterized",
340-
# tensorflow package dep,
340+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
341341
# python/framework:constant_op tensorflow dep,
342342
# python/framework:dtypes tensorflow dep,
343343
# python/framework:test_lib tensorflow dep,
@@ -361,8 +361,8 @@ py_tf_text_library(
361361
"//tensorflow_text/core/kernels/sentencepiece:sentencepiece_detokenizer_kernel",
362362
],
363363
deps = [
364-
# tensorflow package dep,
365364
"//tensorflow_text/core/pybinds:pywrap_model_converter",
365+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
366366
],
367367
)
368368

@@ -381,7 +381,7 @@ py_test(
381381
"@absl_py//absl/flags",
382382
"@absl_py//absl/logging",
383383
"@absl_py//absl/testing:parameterized",
384-
# tensorflow package dep,
384+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
385385
],
386386
)
387387

@@ -417,7 +417,7 @@ py_test(
417417
deps = [
418418
":tensorflow_text",
419419
"@absl_py//absl/testing:parameterized",
420-
# tensorflow package dep,
420+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
421421
# python/compat tensorflow dep,
422422
# python/data/kernel_tests:test_base tensorflow dep,
423423
# python/framework:dtypes tensorflow dep,
@@ -460,7 +460,7 @@ py_test(
460460
deps = [
461461
":tensorflow_text",
462462
"@absl_py//absl/testing:parameterized",
463-
# tensorflow package dep,
463+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
464464
# python/compat tensorflow dep,
465465
# python/data/kernel_tests:test_base tensorflow dep,
466466
# python/framework:dtypes tensorflow dep,
@@ -491,7 +491,7 @@ py_test(
491491
srcs = ["python/ops/greedy_constrained_sequence_op_test.py"],
492492
deps = [
493493
":greedy_constrained_sequence_op",
494-
# numpy dep,
494+
"@pypi//numpy:pkg",
495495
# python/framework:test_lib tensorflow dep,
496496
# python/ops/ragged:ragged_factory_ops tensorflow dep,
497497
# python/platform:client_testlib tensorflow dep,
@@ -688,7 +688,7 @@ py_test(
688688
srcs = ["python/ops/ngrams_op_test.py"],
689689
deps = [
690690
":tensorflow_text",
691-
# tensorflow package dep,
691+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
692692
# python/framework:constant_op tensorflow dep,
693693
# python/framework:errors tensorflow dep,
694694
# python/framework:test_lib tensorflow dep,
@@ -856,7 +856,7 @@ py_test(
856856
srcs = ["python/ragged/ragged_tensor_to_tensor_test.py"],
857857
deps = [
858858
":tensorflow_text",
859-
# tensorflow package dep,
859+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
860860
# python/framework:constant_op tensorflow dep,
861861
# python/framework:test_lib tensorflow dep,
862862
# python/ops/ragged:ragged_factory_ops tensorflow dep,
@@ -881,7 +881,7 @@ py_test(
881881
srcs = ["python/ops/regex_split_ops_test.py"],
882882
deps = [
883883
":regex_split_ops",
884-
# tensorflow package dep,
884+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
885885
# python/framework:test_lib tensorflow dep,
886886
],
887887
)
@@ -1108,7 +1108,7 @@ py_test(
11081108
":state_based_sentence_breaker_op",
11091109
":tensorflow_text",
11101110
"@absl_py//absl/testing:parameterized",
1111-
# tensorflow package dep,
1111+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
11121112
# python/framework:constant_op tensorflow dep,
11131113
# python/framework:dtypes tensorflow dep,
11141114
# python/framework:errors tensorflow dep,
@@ -1176,7 +1176,7 @@ py_library(
11761176
name = "todense_layer",
11771177
srcs = ["python/keras/layers/todense.py"],
11781178
deps = [
1179-
# tensorflow package dep,
1179+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
11801180
],
11811181
)
11821182

@@ -1188,8 +1188,8 @@ py_test(
11881188
deps = [
11891189
":todense_layer",
11901190
"@absl_py//absl/testing:parameterized",
1191-
# numpy dep,
1192-
# tensorflow package dep,
1191+
"@pypi//numpy:pkg",
1192+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
11931193
# python/framework:test_lib tensorflow dep,
11941194
],
11951195
)
@@ -1210,7 +1210,7 @@ py_library(
12101210
":unicode_script_tokenizer",
12111211
":whitespace_tokenizer_v2",
12121212
":wordpiece_tokenizer",
1213-
# tensorflow package dep,
1213+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
12141214
# python/ops:lookup_ops tensorflow dep,
12151215
# python/ops/ragged:ragged_conversion_ops tensorflow dep,
12161216
],
@@ -1224,8 +1224,8 @@ py_test(
12241224
deps = [
12251225
":tokenization_layers",
12261226
"@absl_py//absl/testing:parameterized",
1227-
# numpy dep,
1228-
# tensorflow package dep,
1227+
"@pypi//numpy:pkg",
1228+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
12291229
],
12301230
)
12311231

@@ -1258,7 +1258,7 @@ py_test(
12581258
":tensorflow_text",
12591259
":trimmer_ops",
12601260
"@absl_py//absl/testing:parameterized",
1261-
# tensorflow package dep,
1261+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
12621262
# python/framework:constant_op tensorflow dep,
12631263
# python/framework:test_lib tensorflow dep,
12641264
# python/ops/ragged:ragged_factory_ops tensorflow dep,
@@ -1357,7 +1357,7 @@ py_test(
13571357
deps = [
13581358
":tensorflow_text",
13591359
":utf8_binarize_op",
1360-
# tensorflow package dep,
1360+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
13611361
# python/framework:test_lib tensorflow dep,
13621362
# python/platform:client_testlib tensorflow dep,
13631363
],
@@ -1384,7 +1384,7 @@ py_test(
13841384
deps = [
13851385
":viterbi_constrained_sequence_op",
13861386
":viterbi_decode",
1387-
# numpy dep,
1387+
"@pypi//numpy:pkg",
13881388
# python/framework:test_lib tensorflow dep,
13891389
# python/ops/ragged:ragged_factory_ops tensorflow dep,
13901390
# python/platform:client_testlib tensorflow dep,
@@ -1395,7 +1395,7 @@ py_library(
13951395
name = "viterbi_decode",
13961396
srcs = ["python/numpy/viterbi_decode.py"],
13971397
deps = [
1398-
# numpy dep,
1398+
"@pypi//numpy:pkg",
13991399
] + extra_py_deps(),
14001400
)
14011401

@@ -1406,7 +1406,7 @@ py_test(
14061406
deps = [
14071407
":viterbi_decode",
14081408
"@absl_py//absl/testing:absltest",
1409-
# numpy dep,
1409+
"@pypi//numpy:pkg",
14101410
],
14111411
)
14121412

@@ -1459,7 +1459,7 @@ py_test(
14591459
shard_count = 4,
14601460
deps = [
14611461
":tensorflow_text",
1462-
# tensorflow package dep,
1462+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
14631463
# python/framework:constant_op tensorflow dep,
14641464
# python/framework:test_lib tensorflow dep,
14651465
# python/ops/ragged:ragged_factory_ops tensorflow dep,
@@ -1551,8 +1551,8 @@ py_library(
15511551
name = "benchmark_utils",
15521552
srcs = ["python/benchmarks/benchmark_utils.py"],
15531553
deps = [
1554-
# numpy dep,
1555-
# tensorflow package dep,
1554+
"@pypi//numpy:pkg",
1555+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
15561556
# tensorflow datasets dep,
15571557
# python/client:session tensorflow dep,
15581558
# python/data/ops:dataset_ops tensorflow dep,
@@ -1578,7 +1578,7 @@ py_test(
15781578
":ops",
15791579
"@absl_py//absl:app",
15801580
"@absl_py//absl/testing:parameterized",
1581-
# tensorflow package dep,
1581+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
15821582
# python/framework:dtypes tensorflow dep,
15831583
# python/user_ops:ops tensorflow dep,
15841584
],
@@ -1593,7 +1593,7 @@ py_test(
15931593
":ops",
15941594
"@absl_py//absl:app",
15951595
"@absl_py//absl/testing:parameterized",
1596-
# tensorflow package dep,
1596+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
15971597
# python/user_ops:ops tensorflow dep,
15981598
],
15991599
)

‎tensorflow_text/core/kernels/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ cc_test(
3030
srcs = ["boise_offset_converter_test.cc"],
3131
deps = [
3232
":boise_offset_converter",
33-
"//third_party/absl/strings:string_view",
3433
"@com_google_absl//absl/strings",
34+
"@com_google_absl//absl/strings:string_view",
3535
"@com_google_googletest//:gtest_main",
3636
],
3737
)

‎tensorflow_text/core/kernels/darts_clone_trie_builder.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ absl::StatusOr<std::vector<uint32_t>> BuildDartsCloneTrie(
8989
trie->build(trie_keys.size(), const_cast<char**>(&trie_keys[0]), nullptr,
9090
const_cast<int*>(&trie_values[0]));
9191

92-
// Return the data of darts_clone (an array of 32-bit unsigned int). See:
93-
// http://google3/third_party/darts_clone/include/darts.h?l=53-55&rcl=245017625
92+
// Return the data of darts_clone (an array of 32-bit unsigned int).
9493
const uint32_t* trie_array = static_cast<const uint32_t*>(trie->array());
9594
return std::vector<uint32_t>(trie_array, trie_array + trie->size());
9695
}

‎tensorflow_text/core/kernels/sentencepiece/optimized_decoder_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ absl::Status StdReadFileToString(const std::string& filepath,
7272
namespace {
7373

7474
static char kConfigFilePath[] =
75-
"/google3/third_party/tensorflow_text/python/ops/test_data/"
75+
"/tensorflow_text/python/ops/test_data/"
7676
"fast_sentencepiece.model";
7777

7878
TEST(OptimizedEncoder, ConfigConverter) {

‎tensorflow_text/core/kernels/sentencepiece/optimized_encoder_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ absl::Status StdReadFileToString(const std::string& filepath,
7474
namespace {
7575

7676
static char kConfigFilePath[] =
77-
"/google3/third_party/tensorflow_text/python/ops/test_data/"
77+
"/tensorflow_text/python/ops/test_data/"
7878
"fast_sentencepiece.model";
7979

8080
TEST(OptimizedEncoder, NormalizeStringWhitestpaces) {

‎tensorflow_text/core/pybinds/BUILD

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ py_test(
7575
],
7676
deps = [
7777
":pywrap_fast_bert_normalizer_model_builder",
78-
# tensorflow package dep,
78+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
7979
],
8080
)
8181

@@ -106,7 +106,7 @@ py_test(
106106
],
107107
deps = [
108108
":pywrap_fast_wordpiece_tokenizer_model_builder",
109-
# tensorflow package dep,
109+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
110110
],
111111
)
112112

@@ -141,7 +141,7 @@ py_test(
141141
],
142142
deps = [
143143
":pywrap_phrase_tokenizer_model_builder",
144-
# tensorflow package dep,
144+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
145145
],
146146
)
147147

@@ -190,6 +190,6 @@ py_test(
190190
srcs = ["pywrap_whitespace_tokenizer_config_builder_test.py"],
191191
deps = [
192192
":pywrap_whitespace_tokenizer_config_builder",
193-
# tensorflow package dep,
193+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
194194
],
195195
)

‎tensorflow_text/tools/wordpiece_vocab/BUILD

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ py_library(
2222
name = "wordpiece_tokenizer_learner_lib",
2323
srcs = ["wordpiece_tokenizer_learner_lib.py"],
2424
deps = [
25-
# numpy dep,
25+
"@pypi//numpy:pkg",
2626
],
2727
)
2828

@@ -31,7 +31,7 @@ py_test(
3131
srcs = ["wordpiece_tokenizer_learner_test.py"],
3232
deps = [
3333
":wordpiece_tokenizer_learner_lib",
34-
# numpy dep,
34+
"@pypi//numpy:pkg",
3535
# python/data/ops:dataset_ops tensorflow dep,
3636
"//tensorflow_text:ops",
3737
],
@@ -53,7 +53,7 @@ py_test(
5353
":bert_vocab_from_dataset",
5454
":wordpiece_tokenizer_learner_lib",
5555
"@absl_py//absl/testing:absltest",
56-
# numpy dep,
57-
# tensorflow package dep,
56+
"@pypi//numpy:pkg",
57+
"@release_or_nightly//:tensorflow_pkg", # tensorflow package dep
5858
],
5959
)

‎third_party/icu/data/BUILD

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ exports_files(["LICENSE"])
1414
# Note: I had to build from master, but I'm sure any version after 64.2 would
1515
# will work.
1616
#
17-
# For guidance, see: go/icu-data &
18-
# http://google3/third_party/icu/g3data/icu_data.bzl?l=47&rcl=252943749
17+
# For guidance, see: go/icu-data & icu_data.bzl
1918
#
2019
# First, download, build, and install ICU. This installs tools such as makeconv.
2120
# Then, run the following from your icu4c/source directory:

0 commit comments

Comments
 (0)
Please sign in to comment.