Skip to content

Commit

Permalink
Move headers from include/ to include/pytorch/tokenizers/
Browse files Browse the repository at this point in the history
Summary: Mostly for avoiding internal confusion.

Differential Revision: D69677244
  • Loading branch information
larryliu0820 authored and facebook-github-bot committed Feb 14, 2025
1 parent bba6759 commit f483d83
Show file tree
Hide file tree
Showing 25 changed files with 21 additions and 22 deletions.
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.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/bpe_tokenizer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
// @lint-ignore-every LICENSELINT

#include "detail/bpe_tokenizer_base.h"
#include <pytorch/tokenizers/bpe_tokenizer_base.h>

// Standard
#include <inttypes.h>
Expand Down
2 changes: 1 addition & 1 deletion src/hf_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
// @lint-ignore-every LICENSELINT

#include "hf_tokenizer.h"
#include <pytorch/tokenizers/hf_tokenizer.h>

// Standard
#include <filesystem>
Expand Down
2 changes: 1 addition & 1 deletion src/llama2c_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree.
*/
// @lint-ignore-every CLANGTIDY facebook-hte-RelativeInclude
#include "llama2c_tokenizer.h"
#include <pytorch/tokenizers/llama2c_tokenizer.h>
#include <cstring>

namespace tokenizers {
Expand Down
8 changes: 4 additions & 4 deletions src/pre_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "pre_tokenizer.h"

// Local
#include <pytorch/tokenizers/pre_tokenizer.h>
#include <pytorch/tokenizers/third-party/llama.cpp-unicode/unicode.h>

// Standard
#include <algorithm>
Expand All @@ -15,9 +18,6 @@
// Third Party
#include <nlohmann/json.hpp>

// Local
#include "unicode.h"

using json = nlohmann::json;

namespace tokenizers {
Expand Down
2 changes: 1 addition & 1 deletion src/sentencepiece.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// A tokenizer that works with sentencepiece.

#include "sentencepiece.h"
#include <pytorch/tokenizers/sentencepiece.h>
#include <cinttypes>
#include <string>
#include "third_party/absl/strings/str_replace.h"
Expand Down
4 changes: 2 additions & 2 deletions src/tiktoken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
limitations under the License.
*************************************************************************/

#include "tiktoken.h"
#include <pytorch/tokenizers/base64.h>
#include <pytorch/tokenizers/tiktoken.h>
#include <cinttypes>
#include <fstream>
#include <limits>
#include "base64.h"
#include "re2/re2.h"

namespace tokenizers {
Expand Down
4 changes: 2 additions & 2 deletions src/token_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
// @lint-ignore-every LICENSELINT

#include "token_decoder.h"
#include <pytorch/tokenizers/token_decoder.h>

// Standard
#include <cstdarg>
Expand All @@ -16,7 +16,7 @@
#include <nlohmann/json.hpp>

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

using json = nlohmann::json;

Expand Down
9 changes: 4 additions & 5 deletions targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ def define_common_targets():
runtime.cxx_library(
name = "headers",
exported_headers = subdir_glob([
("include", "*.h"),
("include", "**/*.h"),
("include", "pytorch/tokenizers/*.h"),
("include", "pytorch/tokenizers/**/*.h"),
]),
header_namespace = "",
visibility = [
"@EXECUTORCH_CLIENTS",
],
header_namespace = "",
)

runtime.cxx_library(
Expand Down Expand Up @@ -66,9 +66,8 @@ def define_common_targets():
"third-party/llama.cpp-unicode/src/unicode-data.cpp",
],
exported_headers = subdir_glob([
("third-party/llama.cpp-unicode/include", "*.h"),
("third-party/llama.cpp-unicode/include", "pytorch/tokenizers/third-party/llama.cpp-unicode/*.h"),
]),
header_namespace = "",
)

runtime.cxx_library(
Expand Down
2 changes: 1 addition & 1 deletion test/test_base64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree.
*/

#include "base64.h"
#include <pytorch/tokenizers/base64.h>
#include "gtest/gtest.h"

namespace tokenizers {
Expand Down
2 changes: 1 addition & 1 deletion test/test_llama2c_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <TestResourceUtils/TestResourceUtils.h>
#endif
#include <gtest/gtest.h>
#include "llama2c_tokenizer.h"
#include <pytorch/tokenizers/llama2c_tokenizer.h>

using namespace ::testing;

Expand Down
2 changes: 1 addition & 1 deletion test/test_pre_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <re2/re2.h>

// Local
#include "pre_tokenizer.h"
#include <pytorch/tokenizers/pre_tokenizer.h>

using json = nlohmann::json;
using namespace tokenizers;
Expand Down
2 changes: 1 addition & 1 deletion test/test_sentencepiece.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <TestResourceUtils/TestResourceUtils.h>
#endif
#include <gtest/gtest.h>
#include "sentencepiece.h"
#include <pytorch/tokenizers/sentencepiece.h>

namespace tokenizers {

Expand Down
2 changes: 1 addition & 1 deletion test/test_tiktoken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <TestResourceUtils/TestResourceUtils.h>
#endif
#include <gtest/gtest.h>
#include "tiktoken.h"
#include <pytorch/tokenizers/tiktoken.h>

using namespace ::testing;

Expand Down

0 comments on commit f483d83

Please sign in to comment.