Skip to content

Commit 4729e04

Browse files
committed
include libs in manifest and some modeltype placeholders (todos)
1 parent c56dd53 commit 4729e04

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
@@ -125,7 +125,8 @@ private void setLocalModel(String modelPath, String tokenizerPath, float tempera
125125
long runStartTime = System.currentTimeMillis();
126126
mModule =
127127
new LlamaModule(
128-
ModelUtils.getModelCategory(mCurrentSettingsFields.getModelType()),
128+
//ModelUtils.getModelCategory(mCurrentSettingsFields.getModelType()),
129+
3, //TODO: Modify this based on JNI change for how to select MTK backend
129130
modelPath,
130131
tokenizerPath,
131132
temperature);
@@ -229,6 +230,7 @@ protected void onCreate(Bundle savedInstanceState) {
229230

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

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)