Skip to content

Commit 473df33

Browse files
authored
JNI replace llama runner with llm text runner (#13784)
Use the API from extension/llm
1 parent e2098f8 commit 473df33

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

extension/android/jni/jni_layer_llama.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
#include <unordered_map>
1414
#include <vector>
1515

16-
#include <executorch/examples/models/llama/runner/runner.h>
1716
#include <executorch/examples/models/llava/runner/llava_runner.h>
18-
#include <executorch/examples/qualcomm/oss_scripts/llama/runner/runner.h>
1917
#include <executorch/extension/llm/runner/image.h>
2018
#include <executorch/extension/llm/runner/irunner.h>
19+
#include <executorch/extension/llm/runner/llm_runner_helper.h>
20+
#include <executorch/extension/llm/runner/multimodal_input.h>
21+
#include <executorch/extension/llm/runner/multimodal_runner.h>
22+
#include <executorch/extension/llm/runner/text_llm_runner.h>
2123
#include <executorch/runtime/platform/log.h>
2224
#include <executorch/runtime/platform/platform.h>
2325
#include <executorch/runtime/platform/runtime.h>
@@ -174,11 +176,9 @@ class ExecuTorchLlmJni : public facebook::jni::HybridClass<ExecuTorchLlmJni> {
174176
std::optional<const std::string> data_path_str = data_path
175177
? std::optional<const std::string>{data_path->toStdString()}
176178
: std::nullopt;
177-
// TODO(larryliu0820): Use the API in text_llm_runner.h to create the
178-
// runner.
179-
runner_ = example::create_llama_runner(
179+
runner_ = executorch::extension::llm::create_text_llm_runner(
180180
model_path->toStdString(),
181-
tokenizer_path->toStdString(),
181+
llm::load_tokenizer(tokenizer_path->toStdString()),
182182
data_path_str);
183183
#if defined(EXECUTORCH_BUILD_QNN)
184184
} else if (model_type_category == MODEL_TYPE_QNN_LLAMA) {

0 commit comments

Comments
 (0)