1load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") 2 3def define_common_targets(): 4 """Defines targets that should be shared between fbcode and xplat. 5 6 The directory containing this targets.bzl file should also contain both 7 TARGETS and BUCK files that call this function. 8 """ 9 runtime.cxx_library( 10 name = "tiktoken", 11 srcs = [ 12 "llama_tiktoken.cpp", 13 ], 14 exported_headers = [ 15 "llama_tiktoken.h", 16 ], 17 exported_deps = [ 18 "//executorch/extension/llm/tokenizer:tiktoken", 19 ], 20 visibility = [ 21 "@EXECUTORCH_CLIENTS", 22 ], 23 ) 24 25 runtime.python_library( 26 name = "tiktoken_py", 27 srcs = [ 28 "tiktoken.py", 29 ], 30 _is_external_target = True, 31 visibility = [ 32 "//bento/...", 33 "//bento_kernels/...", 34 "//executorch/...", 35 ], 36 deps = [ 37 "fbsource//third-party/pypi/tiktoken:tiktoken", 38 ], 39 ) 40