Skip to content

Commit 6bd7c29

Browse files
committed
Add android-26 and rename runner_inferface to irunner
1 parent 03c12c8 commit 6bd7c29

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

build/build_android_llm_demo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ build_android_native_library() {
3737
cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
3838
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
3939
-DANDROID_ABI="${ANDROID_ABI}" \
40+
-DANDROID_PLATFORM=android-26 \
4041
-DEXECUTORCH_ENABLE_LOGGING=ON \
4142
-DEXECUTORCH_LOG_LEVEL=Info \
4243
-DEXECUTORCH_BUILD_XNNPACK=ON \
@@ -65,6 +66,7 @@ build_android_native_library() {
6566
cmake extension/android \
6667
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
6768
-DANDROID_ABI="${ANDROID_ABI}" \
69+
-DANDROID_PLATFORM=android-26 \
6870
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
6971
-DEXECUTORCH_ENABLE_LOGGING=ON \
7072
-DEXECUTORCH_LOG_LEVEL=Info \

examples/mediatek/executor_runner/mtk_llama_runner.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ Error MTKLlamaRunner::generate(
120120
const std::string& prompt,
121121
int32_t seq_len,
122122
std::function<void(const std::string&)> token_callback,
123-
std::function<void(const Stats&)> stats_callback
124-
bool,
125-
bool) {
123+
std::function<void(const Stats&)> stats_callback,
124+
bool echo,
125+
bool warming) {
126126
if (!is_loaded()) {
127127
ET_CHECK_OK_OR_RETURN_ERROR(load());
128128
}

examples/mediatek/executor_runner/mtk_llama_runner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#pragma once
1313

1414
#include <executorch/examples/models/llama/tokenizer/llama_tiktoken.h>
15-
#include <executorch/extension/llm/runner/runner_interface.h>
15+
#include <executorch/extension/llm/runner/irunner.h>
1616
#include <executorch/extension/llm/runner/stats.h>
1717
#include <executorch/extension/llm/tokenizer/bpe_tokenizer.h>
1818
#include <executorch/extension/llm/tokenizer/tiktoken.h>
@@ -33,7 +33,7 @@ using executorch::runtime::Error;
3333
using executorch::runtime::Result;
3434

3535
class MTKLlamaRunner
36-
: public executorch::extension::llm::RunnerInterface {
36+
: public executorch::extension::llm::IRunner {
3737
public:
3838
explicit MTKLlamaRunner(
3939
const std::string& model_path,

extension/android/jni/jni_layer_llama.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <executorch/examples/models/llama/runner/runner.h>
1717
#include <executorch/examples/models/llava/runner/llava_runner.h>
1818
#include <executorch/extension/llm/runner/image.h>
19-
#include <executorch/extension/llm/runner/runner_interface.h>
19+
#include <executorch/extension/llm/runner/irunner.h>
2020
#include <executorch/runtime/platform/log.h>
2121
#include <executorch/runtime/platform/platform.h>
2222
#include <executorch/runtime/platform/runtime.h>
@@ -116,7 +116,7 @@ class ExecuTorchLlamaJni
116116
private:
117117
friend HybridBase;
118118
int model_type_category_;
119-
std::unique_ptr<llm::RunnerInterface> runner_;
119+
std::unique_ptr<llm::IRunner> runner_;
120120
std::unique_ptr<llm::MultimodalRunner> multi_modal_runner_;
121121

122122
public:

0 commit comments

Comments
 (0)