Skip to content

Commit

Permalink
Check preprocessor flag using #if instead of #ifdef. (#3525)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #3525

.

Reviewed By: larryliu0820

Differential Revision: D57031655

fbshipit-source-id: f976f44202a09b262223a90986179a8af59f44a9
  • Loading branch information
shoumikhin authored and facebook-github-bot committed May 7, 2024
1 parent 0beb072 commit a116d89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/models/llama2/runner/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// The module takes in a string as input and emits a string as output.

#include <executorch/examples/models/llama2/runner/runner.h>
#if defined(ET_USE_TIKTOKEN)
#if ET_USE_TIKTOKEN
#include <executorch/examples/models/llama2/tokenizer/tiktoken.h>
#else /* BPE */
#include <executorch/examples/models/llama2/tokenizer/bpe_tokenizer.h>
Expand Down Expand Up @@ -81,7 +81,7 @@ Error Runner::load() {
append_eos_ = getMetadataHelper("append_eos_to_prompt", false);

// Load tokenizer
#if defined(ET_USE_TIKTOKEN)
#if ET_USE_TIKTOKEN
tokenizer_ = std::make_unique<Tiktoken>(vocab_size_, bos_id_, eos_id_);
#else
tokenizer_ = std::make_unique<BPETokenizer>(vocab_size_, bos_id_, eos_id_);
Expand Down

0 comments on commit a116d89

Please sign in to comment.