-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Differential Revision: D69509028 Pull Request resolved: #17
- Loading branch information
1 parent
f2fc3d6
commit 03744ce
Showing
23 changed files
with
369 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Any targets that should be shared between fbcode and xplat must be defined in | ||
# targets.bzl. This file can contain fbcode-only targets. | ||
|
||
load(":targets.bzl", "define_common_targets") | ||
|
||
oncall("executorch") | ||
|
||
define_common_targets() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
load("@fbsource//tools/build_defs:glob_defs.bzl", "subdir_glob") | ||
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
|
||
def define_common_targets(): | ||
"""Defines targets that should be shared between fbcode and xplat. | ||
The directory containing this targets.bzl file should also contain both | ||
TARGETS and BUCK files that call this function. | ||
""" | ||
|
||
runtime.cxx_library( | ||
name = "headers", | ||
exported_headers = subdir_glob([ | ||
("include", "*.h"), | ||
("include", "**/*.h"), | ||
]), | ||
header_namespace = "", | ||
visibility = [ | ||
"@EXECUTORCH_CLIENTS", | ||
], | ||
) | ||
|
||
runtime.cxx_library( | ||
name = "sentencepiece", | ||
srcs = [ | ||
"src/sentencepiece.cpp", | ||
], | ||
exported_deps = [ | ||
":headers", | ||
], | ||
visibility = [ | ||
"@EXECUTORCH_CLIENTS", | ||
], | ||
compiler_flags = [ | ||
"-D_USE_INTERNAL_STRING_VIEW", | ||
], | ||
external_deps = [ | ||
"sentencepiece", | ||
], | ||
) | ||
|
||
runtime.cxx_library( | ||
name = "tiktoken", | ||
srcs = [ | ||
"src/tiktoken.cpp", | ||
"src/bpe_tokenizer_base.cpp", | ||
], | ||
exported_deps = [ | ||
":headers", | ||
], | ||
visibility = [ | ||
"@EXECUTORCH_CLIENTS", | ||
], | ||
compiler_flags = [ | ||
"-D_USE_INTERNAL_STRING_VIEW", | ||
], | ||
exported_external_deps = [ | ||
"re2", | ||
], | ||
) | ||
|
||
runtime.cxx_library( | ||
name = "unicode", | ||
srcs = [ | ||
"third-party/llama.cpp-unicode/src/unicode.cpp", | ||
"third-party/llama.cpp-unicode/src/unicode-data.cpp", | ||
], | ||
exported_headers = subdir_glob([ | ||
("third-party/llama.cpp-unicode/include", "*.h"), | ||
]), | ||
header_namespace = "", | ||
) | ||
|
||
runtime.cxx_library( | ||
name = "hf_tokenizer", | ||
srcs = [ | ||
"src/hf_tokenizer.cpp", | ||
"src/bpe_tokenizer_base.cpp", | ||
"src/pre_tokenizer.cpp", | ||
"src/token_decoder.cpp", | ||
], | ||
exported_deps = [ | ||
":headers", | ||
":unicode", | ||
], | ||
visibility = [ | ||
"@EXECUTORCH_CLIENTS", | ||
], | ||
compiler_flags = [ | ||
"-D_USE_INTERNAL_STRING_VIEW", | ||
], | ||
exported_external_deps = [ | ||
"re2", | ||
"nlohmann_json", | ||
], | ||
) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tet 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ICAgICAgIA== 18446744073709551616 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ICAgICAgIA==10 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.