Skip to content

Commit

Permalink
fix: incorrect C/C++ preprocessor macro
Browse files Browse the repository at this point in the history
When -DENABLE_ENCODER is given, you do
 #ifdef ENABLE_ENCODER
not
 #ifdef DENABLE_ENCODER

CC: @baek2sm

Signed-off-by: MyungJoo Ham <[email protected]>
  • Loading branch information
myungjoo committed Jul 26, 2024
1 parent 5186d4d commit 428768c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Applications/PicoGPT/jni/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <string.h>
#include <tensor.h>

#if defined(DENABLE_ENCODER)
#if defined(ENABLE_ENCODER)
#include "encoder.hpp"
#endif

Expand All @@ -43,7 +43,7 @@ bool optimize = false;
// bool optimize = true;
bool optimize_attention = false;

#if defined(DENABLE_ENCODER)
#if defined(ENABLE_ENCODER)
template <typename T>
T unwrap(std::optional<T> &&value, const std::string &error_msg) {
if (value.has_value()) {
Expand Down Expand Up @@ -318,7 +318,7 @@ int main(int argc, char *argv[]) {

std::vector<int64_t> init_input;

#if defined(DENABLE_ENCODER)
#if defined(ENABLE_ENCODER)

std::string vocab_file_name = "../Applications/PicoGPT/jni/vocab.json";
std::string merge_file_name = "../Applications/PicoGPT/jni/merges.txt";
Expand Down Expand Up @@ -372,7 +372,7 @@ int main(int argc, char *argv[]) {

((uint *)(wpe_input))[0] = i;

#if defined(DENABLE_ENCODER)
#if defined(ENABLE_ENCODER)
std::vector<int64_t> token_ids;
for (auto element : ids) {
token_ids.push_back(static_cast<int64_t>(element));
Expand Down

0 comments on commit 428768c

Please sign in to comment.