Skip to content

Commit f483d83

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Move headers from include/ to include/pytorch/tokenizers/
Summary: Mostly for avoiding internal confusion. Differential Revision: D69677244
1 parent bba6759 commit f483d83

25 files changed

+21
-22
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/bpe_tokenizer_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
// @lint-ignore-every LICENSELINT
99

10-
#include "detail/bpe_tokenizer_base.h"
10+
#include <pytorch/tokenizers/bpe_tokenizer_base.h>
1111

1212
// Standard
1313
#include <inttypes.h>

src/hf_tokenizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
// @lint-ignore-every LICENSELINT
99

10-
#include "hf_tokenizer.h"
10+
#include <pytorch/tokenizers/hf_tokenizer.h>
1111

1212
// Standard
1313
#include <filesystem>

src/llama2c_tokenizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88
// @lint-ignore-every CLANGTIDY facebook-hte-RelativeInclude
9-
#include "llama2c_tokenizer.h"
9+
#include <pytorch/tokenizers/llama2c_tokenizer.h>
1010
#include <cstring>
1111

1212
namespace tokenizers {

src/pre_tokenizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
* This source code is licensed under the BSD-style license found in the
66
* LICENSE file in the root directory of this source tree.
77
*/
8-
#include "pre_tokenizer.h"
8+
9+
// Local
10+
#include <pytorch/tokenizers/pre_tokenizer.h>
11+
#include <pytorch/tokenizers/third-party/llama.cpp-unicode/unicode.h>
912

1013
// Standard
1114
#include <algorithm>
@@ -15,9 +18,6 @@
1518
// Third Party
1619
#include <nlohmann/json.hpp>
1720

18-
// Local
19-
#include "unicode.h"
20-
2121
using json = nlohmann::json;
2222

2323
namespace tokenizers {

src/sentencepiece.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// A tokenizer that works with sentencepiece.
1010

11-
#include "sentencepiece.h"
11+
#include <pytorch/tokenizers/sentencepiece.h>
1212
#include <cinttypes>
1313
#include <string>
1414
#include "third_party/absl/strings/str_replace.h"

src/tiktoken.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
limitations under the License.
2626
*************************************************************************/
2727

28-
#include "tiktoken.h"
28+
#include <pytorch/tokenizers/base64.h>
29+
#include <pytorch/tokenizers/tiktoken.h>
2930
#include <cinttypes>
3031
#include <fstream>
3132
#include <limits>
32-
#include "base64.h"
3333
#include "re2/re2.h"
3434

3535
namespace tokenizers {

src/token_decoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
// @lint-ignore-every LICENSELINT
99

10-
#include "token_decoder.h"
10+
#include <pytorch/tokenizers/token_decoder.h>
1111

1212
// Standard
1313
#include <cstdarg>
@@ -16,7 +16,7 @@
1616
#include <nlohmann/json.hpp>
1717

1818
// Local
19-
#include "unicode.h"
19+
#include <pytorch/tokenizers/third-party/llama.cpp-unicode/unicode.h>
2020

2121
using json = nlohmann::json;
2222

targets.bzl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def define_common_targets():
1111
runtime.cxx_library(
1212
name = "headers",
1313
exported_headers = subdir_glob([
14-
("include", "*.h"),
15-
("include", "**/*.h"),
14+
("include", "pytorch/tokenizers/*.h"),
15+
("include", "pytorch/tokenizers/**/*.h"),
1616
]),
17-
header_namespace = "",
1817
visibility = [
1918
"@EXECUTORCH_CLIENTS",
2019
],
20+
header_namespace = "",
2121
)
2222

2323
runtime.cxx_library(
@@ -66,9 +66,8 @@ def define_common_targets():
6666
"third-party/llama.cpp-unicode/src/unicode-data.cpp",
6767
],
6868
exported_headers = subdir_glob([
69-
("third-party/llama.cpp-unicode/include", "*.h"),
69+
("third-party/llama.cpp-unicode/include", "pytorch/tokenizers/third-party/llama.cpp-unicode/*.h"),
7070
]),
71-
header_namespace = "",
7271
)
7372

7473
runtime.cxx_library(

test/test_base64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include "base64.h"
9+
#include <pytorch/tokenizers/base64.h>
1010
#include "gtest/gtest.h"
1111

1212
namespace tokenizers {

test/test_llama2c_tokenizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <TestResourceUtils/TestResourceUtils.h>
1111
#endif
1212
#include <gtest/gtest.h>
13-
#include "llama2c_tokenizer.h"
13+
#include <pytorch/tokenizers/llama2c_tokenizer.h>
1414

1515
using namespace ::testing;
1616

test/test_pre_tokenizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <re2/re2.h>
1313

1414
// Local
15-
#include "pre_tokenizer.h"
15+
#include <pytorch/tokenizers/pre_tokenizer.h>
1616

1717
using json = nlohmann::json;
1818
using namespace tokenizers;

test/test_sentencepiece.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <TestResourceUtils/TestResourceUtils.h>
1212
#endif
1313
#include <gtest/gtest.h>
14-
#include "sentencepiece.h"
14+
#include <pytorch/tokenizers/sentencepiece.h>
1515

1616
namespace tokenizers {
1717

test/test_tiktoken.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <TestResourceUtils/TestResourceUtils.h>
1212
#endif
1313
#include <gtest/gtest.h>
14-
#include "tiktoken.h"
14+
#include <pytorch/tokenizers/tiktoken.h>
1515

1616
using namespace ::testing;
1717

0 commit comments

Comments
 (0)