Skip to content

Commit dd250e2

Browse files
kirklandsignfacebook-github-bot
authored andcommitted
Adding .model tokenizer to selection
Summary: We should allow both .bin and .model for tokenizer Differential Revision: D56365079
1 parent fa433cb commit dd250e2

File tree

1 file changed

+6
-2
lines changed
  • examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ private String memoryInfo() {
119119
private void modelDialog() {
120120
String[] pteFiles = listLocalFile("/data/local/tmp/llama/", ".pte");
121121
String[] binFiles = listLocalFile("/data/local/tmp/llama/", ".bin");
122+
String[] modelFiles = listLocalFile("/data/local/tmp/llama/", ".model");
123+
String[] tokenizerFiles = new String[binFiles.length + modelFiles.length];
124+
System.arraycopy(binFiles, 0, tokenizerFiles, 0, binFiles.length);
125+
System.arraycopy(modelFiles, 0, tokenizerFiles, binFiles.length, modelFiles.length);
122126
AlertDialog.Builder modelPathBuilder = new AlertDialog.Builder(this);
123127
modelPathBuilder.setTitle("Select model path");
124128
AlertDialog.Builder tokenizerPathBuilder = new AlertDialog.Builder(this);
@@ -134,10 +138,10 @@ private void modelDialog() {
134138
});
135139

136140
tokenizerPathBuilder.setSingleChoiceItems(
137-
binFiles,
141+
tokenizerFiles,
138142
-1,
139143
(dialog, item) -> {
140-
mTokenizerFilePath = binFiles[item];
144+
mTokenizerFilePath = tokenizerFiles[item];
141145
Runnable runnable =
142146
new Runnable() {
143147
@Override

0 commit comments

Comments
 (0)