diff --git a/Applications/LLaMA/jni/main.cpp b/Applications/LLaMA/jni/main.cpp index 985d82a79e..27a86807e9 100644 --- a/Applications/LLaMA/jni/main.cpp +++ b/Applications/LLaMA/jni/main.cpp @@ -30,7 +30,7 @@ #include #include -#if defined(ENABLE_ENCODER2) +#if defined(ENABLE_JSON) #include "json.hpp" #include #include @@ -572,7 +572,7 @@ void run(std::string text, bool apply_temperature) { unsigned int init_len; -#if defined(ENABLE_ENCODER2) +#if defined(ENABLE_JSON) std::string vocab_file_name = "../Applications/LLaMA/jni/vocab.json"; std::string merge_file_name = "../Applications/LLaMA/jni/merges.txt"; @@ -619,7 +619,7 @@ void run(std::string text, bool apply_temperature) { std::cout << " Progress Reading: 100 % " << std::endl; std::cout << std::endl << "### Output : " << std::endl; if (init_len < INIT_SEQ_LEN) { -#if defined(ENABLE_ENCODER2) +#if defined(ENABLE_JSON) auto decoded_str = tokenizer.decode({static_cast(ids)}); std::cout << decoded_str << " "; std::cout.flush(); @@ -635,7 +635,7 @@ void run(std::string text, bool apply_temperature) { input_sample[0] = static_cast(init_input[i]); } else { input_sample[0] = static_cast(ids); -#if defined(ENABLE_ENCODER2) +#if defined(ENABLE_JSON) auto decoded_str = tokenizer.decode({static_cast(ids)}); std::cout << decoded_str << " "; std::cout.flush(); @@ -684,7 +684,7 @@ void createAndRun(unsigned int epochs, unsigned int batch_size) { g_model->load(weight_path); } -#if defined(ENABLE_ENCODER2) +#if defined(ENABLE_JSON) std::wstring decodeUnicodeEscape(const std::wstring &input) { std::wstringstream result; @@ -712,7 +712,7 @@ int main(int argc, char *argv[]) { // Setting locale std::locale::global(std::locale("ko_KR.UTF-8")); -#if defined(ENABLE_ENCODER2) +#if defined(ENABLE_JSON) // Getting arguments From terminal std::wstring input; std::getline(std::wcin, input); diff --git a/Applications/LLaMA/jni/meson.build b/Applications/LLaMA/jni/meson.build index 24ebf6593f..7ace39e094 100644 --- a/Applications/LLaMA/jni/meson.build +++ b/Applications/LLaMA/jni/meson.build @@ -13,7 +13,6 @@ transpose_dep = declare_dependency( ) if get_option('platform') != 'tizen' - extra_defines += '-DENABLE_ENCODER2=1' run_command(meson.source_root() / 'jni' / 'prepare_encoder.sh', meson.build_root(), '0.2' ,check: true) endif diff --git a/Applications/PicoGPT/jni/main.cpp b/Applications/PicoGPT/jni/main.cpp index 30eace3946..f6c86bc286 100644 --- a/Applications/PicoGPT/jni/main.cpp +++ b/Applications/PicoGPT/jni/main.cpp @@ -17,7 +17,7 @@ #include #include -#if defined(ENABLE_ENCODER) +#if defined(ENABLE_JSON) #include "encoder.hpp" #endif @@ -43,7 +43,7 @@ bool optimize = false; // bool optimize = true; bool optimize_attention = false; -#if defined(ENABLE_ENCODER) +#if defined(ENABLE_JSON) template T unwrap(std::optional &&value, const std::string &error_msg) { if (value.has_value()) { @@ -318,7 +318,7 @@ int main(int argc, char *argv[]) { std::vector init_input; -#if defined(ENABLE_ENCODER) +#if defined(ENABLE_JSON) std::string vocab_file_name = "../Applications/PicoGPT/jni/vocab.json"; std::string merge_file_name = "../Applications/PicoGPT/jni/merges.txt"; @@ -372,7 +372,7 @@ int main(int argc, char *argv[]) { ((uint *)(wpe_input))[0] = i; -#if defined(ENABLE_ENCODER) +#if defined(ENABLE_JSON) std::vector token_ids; for (auto element : ids) { token_ids.push_back(static_cast(element)); diff --git a/Applications/PicoGPT/jni/meson.build b/Applications/PicoGPT/jni/meson.build index e542d05b36..b16cd9e8d9 100644 --- a/Applications/PicoGPT/jni/meson.build +++ b/Applications/PicoGPT/jni/meson.build @@ -3,7 +3,6 @@ nntr_pico_gpt_resdir = nntr_app_resdir / 'PicoGPT' run_command('cp', '-lr', res_path, nntr_pico_gpt_resdir) if get_option('platform') != 'tizen' - extra_defines += '-DENABLE_ENCODER=1' run_command(meson.source_root() / 'jni' / 'prepare_encoder.sh', meson.build_root(), '0.1' , check: true) endif diff --git a/meson.build b/meson.build index d4aea330a4..270ec7ed67 100644 --- a/meson.build +++ b/meson.build @@ -34,6 +34,8 @@ if get_option('platform') == 'tizen' if get_option('enable-tizen-feature-check') add_project_arguments('-D__FEATURE_CHECK_SUPPORT__', language: ['c', 'cpp']) endif +else + add_project_arguments('-DENABLE_JSON=1', language: ['c', 'cpp']) endif warning_flags = [