Skip to content

Commit 2ee4adc

Browse files
committed
include libs in manifest and some modeltype placeholders (todos)
1 parent c3d6d16 commit 2ee4adc

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

examples/demo-apps/android/LlamaDemo/app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,30 @@
3636
android:name="libcdsprpc.so"
3737
android:required="false" />
3838

39+
<uses-native-library
40+
android:name="libapuwareutils_v2.mtk.so"
41+
android:required="false" />
42+
43+
<uses-native-library
44+
android:name="libapuwareapusys_v2.mtk.so"
45+
android:required="false" />
46+
47+
<uses-native-library
48+
android:name="libnir_neon_driver_ndk.mtk.so"
49+
android:required="false" />
50+
51+
<uses-native-library
52+
android:name="libnir_neon_driver_ndk.mtk.vndk.so"
53+
android:required="false" />
54+
55+
<uses-native-library
56+
android:name="libcmdl_ndk.mtk.vndk.so"
57+
android:required="false" />
58+
59+
<uses-native-library
60+
android:name="libcmdl_ndk.mtk.so"
61+
android:required="false" />
62+
3963
<activity
4064
android:name=".MainActivity"
4165
android:exported="true"

examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ private void setLocalModel(String modelPath, String tokenizerPath, float tempera
124124
long runStartTime = System.currentTimeMillis();
125125
mModule =
126126
new LlamaModule(
127-
ModelUtils.getModelCategory(mCurrentSettingsFields.getModelType()),
127+
//ModelUtils.getModelCategory(mCurrentSettingsFields.getModelType()),
128+
3, //TODO: Modify this based on JNI change for how to select MTK backend
128129
modelPath,
129130
tokenizerPath,
130131
temperature);
@@ -228,6 +229,7 @@ protected void onCreate(Bundle savedInstanceState) {
228229

229230
try {
230231
Os.setenv("ADSP_LIBRARY_PATH", getApplicationInfo().nativeLibraryDir, true);
232+
Os.setenv("LD_LIBRARY_PATH", getApplicationInfo().nativeLibraryDir, true);
231233
} catch (ErrnoException e) {
232234
finish();
233235
}

examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/ModelUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class ModelUtils {
1212
static final int TEXT_MODEL = 1;
1313
static final int VISION_MODEL = 2;
1414
static final int VISION_MODEL_IMAGE_CHANNELS = 3;
15+
//TODO: Make change here based on JNI change on how to indicate MTK backend
1516
static final int VISION_MODEL_SEQ_LEN = 768;
1617
static final int TEXT_MODEL_SEQ_LEN = 256;
1718

0 commit comments

Comments
 (0)