Skip to content

Commit d071c4f

Browse files
pchxcopybara-github
authored andcommitted
Experiment with sentencepiece 0.2.0
PiperOrigin-RevId: 695436079
1 parent e54d9cb commit d071c4f

File tree

3 files changed

+128
-1690
lines changed

3 files changed

+128
-1690
lines changed

MODULE.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ bazel_dep(name = "googletest", version = "1.15.2")
99
bazel_dep(name = "highway", version = "1.1.0")
1010
bazel_dep(name = "nlohmann_json", version = "3.11.3")
1111
bazel_dep(name = "platforms", version = "0.0.10")
12+
bazel_dep(name = "protobuf", version = "28.3")
1213
bazel_dep(name = "rules_cc", version = "0.0.9")
1314
bazel_dep(name = "rules_license", version = "0.0.7")
1415
bazel_dep(name = "google_benchmark", version = "1.8.5")
@@ -27,9 +28,9 @@ http_archive(
2728
build_file = "@//bazel:sentencepiece.bazel",
2829
patch_args = ["-p1"],
2930
patches = ["@//bazel:sentencepiece.patch"],
30-
sha256 = "8409b0126ebd62b256c685d5757150cf7fcb2b92a2f2b98efb3f38fc36719754",
31-
strip_prefix = "sentencepiece-0.1.96",
32-
urls = ["https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip"],
31+
sha256 = "67c34082deb3d89f589d8614b1ae58aa4af250c79e18737d8103242ec62a28f9",
32+
strip_prefix = "sentencepiece-0.2.0",
33+
urls = ["https://github.com/google/sentencepiece/archive/refs/tags/v0.2.0.zip"],
3334
)
3435

3536
# For sentencepiece

bazel/sentencepiece.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ cc_library(
6666
"src/char_model.h",
6767
"src/filesystem.h",
6868
"src/freelist.h",
69+
"src/init.h",
6970
"src/model_factory.h",
7071
"src/model_interface.h",
7172
"src/normalizer.h",
@@ -75,7 +76,7 @@ cc_library(
7576
"src/util.h",
7677
"src/word_model.h",
7778
],
78-
defines = ["_USE_TF_STRING_VIEW"],
79+
defines = ["_USE_TF_STRING_VIEW", "_USE_EXTERNAL_PROTOBUF"],
7980
includes = [
8081
".",
8182
"src",
@@ -88,10 +89,12 @@ cc_library(
8889
":sentencepiece_model_cc_proto",
8990
"@abseil-cpp//absl/container:flat_hash_map",
9091
"@abseil-cpp//absl/container:flat_hash_set",
92+
"@abseil-cpp//absl/flags:parse",
9193
"@abseil-cpp//absl/memory",
9294
"@abseil-cpp//absl/status",
9395
"@abseil-cpp//absl/strings",
9496
"@abseil-cpp//absl/strings:str_format",
97+
"@protobuf//:protobuf_lite",
9598
"@darts_clone",
9699
],
97100
)

0 commit comments

Comments
 (0)