google-ai-edge_LiteRT/BUILD.sentencepiece
2025-10-16 17:34:53 -07:00

89 lines
2.5 KiB
Plaintext

# Copyright 2025 The Google AI Edge Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package(default_visibility = ["//visibility:public"])
proto_library(
name = "sentencepiece_proto",
srcs = ["sentencepiece.proto"],
)
cc_proto_library(
name = "sentencepiece_cc_proto",
deps = [":sentencepiece_proto"],
)
proto_library(
name = "sentencepiece_model_proto",
srcs = ["sentencepiece_model.proto"],
)
cc_proto_library(
name = "sentencepiece_model_cc_proto",
deps = [":sentencepiece_model_proto"],
)
cc_library(
name = "sentencepiece_processor",
srcs = [
"bpe_model.cc",
"char_model.cc",
"filesystem.cc",
"model_factory.cc",
"model_interface.cc",
"normalizer.cc",
"sentencepiece_processor.cc",
"unigram_model.cc",
"util.cc",
"word_model.cc",
],
hdrs = [
"bpe_model.h",
"char_model.h",
"common.h",
"config.h",
"filesystem.h",
"freelist.h",
"model_factory.h",
"model_interface.h",
"normalizer.h",
"sentencepiece_processor.h",
"sentencepiece_trainer.h",
"trainer_interface.h",
"unigram_model.h",
"util.h",
"word_model.h",
],
copts = [
"-DENABLE_NFKC_COMPILE",
"-DSENTENCEPIECE_PG3_BUILD",
],
deps = [
":sentencepiece_cc_proto",
":sentencepiece_model_cc_proto",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/cleanup",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@darts_clone",
],
)