Skip to content

Commit 5d2fac8

Browse files
committed
Update on "Fix test_llama_runner by hiding tiktoken"
Summary: We don't always want to build tiktoken dependencies (re2 and abseil) so this PR only build it if the option is on. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D56178928](https://our.internmc.facebook.com/intern/diff/D56178928) [ghstack-poisoned]
1 parent 995d2ca commit 5d2fac8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/models/llama2/runner/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,25 @@ target_include_directories(extension_module
4040
INTERFACE ${_common_include_directories})
4141

4242
if(EXECUTORCH_USE_TIKTOKEN)
43-
list(APPEND _llama_runner__srcs ${CMAKE_CURRENT_SOURCE_DIR}/../tokenizer/tiktoken.cpp)
43+
list(APPEND _llama_runner__srcs
44+
${CMAKE_CURRENT_SOURCE_DIR}/../tokenizer/tiktoken.cpp)
4445
set(_preprocessor_flag -DET_USE_TIKTOKEN)
4546
endif()
4647

47-
if(CMAKE_TOOLCHAIN_IOS OR ANDROID OR APPLE)
48-
# Building a share library on iOS requires code signing
49-
# On Android we see duplicated registration when using shared lib
48+
if(CMAKE_TOOLCHAIN_IOS
49+
OR ANDROID
50+
OR APPLE)
51+
# Building a share library on iOS requires code signing On Android we see
52+
# duplicated registration when using shared lib
5053
add_library(llama_runner STATIC ${_llama_runner__srcs})
5154
else()
5255
add_library(llama_runner SHARED ${_llama_runner__srcs})
5356
endif()
5457

5558
set(llama_runner_deps executorch extension_module extension_data_loader)
5659

57-
target_link_libraries(
58-
llama_runner PUBLIC ${llama_runner_deps})
60+
target_link_libraries(llama_runner PUBLIC ${llama_runner_deps})
5961

60-
target_include_directories(llama_runner
61-
INTERFACE ${_common_include_directories}
62-
${EXECUTORCH_ROOT})
62+
target_include_directories(llama_runner INTERFACE ${_common_include_directories}
63+
${EXECUTORCH_ROOT})
6364
target_compile_options(llama_runner PUBLIC ${_preprocessor_flag})

examples/models/llama2/runner/runner.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class Runner {
8585
int32_t n_bos_;
8686
int32_t n_eos_;
8787
int32_t max_seq_len_;
88-
bool use_tiktoken_;
8988
bool use_kv_cache_;
9089
bool use_sdpa_with_kv_cache_;
9190
bool append_eos_;

0 commit comments

Comments
 (0)