Skip to content

Commit

Permalink
Adding .model tokenizer to selection (#3163)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #3163

We should allow both .bin and .model for tokenizer

Reviewed By: shoumikhin

Differential Revision: D56365079

fbshipit-source-id: 9b59d15b0b16ffd5a091d3deadacec0771547f77
  • Loading branch information
kirklandsign authored and facebook-github-bot committed Apr 19, 2024
1 parent 3ef9d2c commit 0800594
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ private String memoryInfo() {
private void modelDialog() {
String[] pteFiles = listLocalFile("/data/local/tmp/llama/", ".pte");
String[] binFiles = listLocalFile("/data/local/tmp/llama/", ".bin");
String[] modelFiles = listLocalFile("/data/local/tmp/llama/", ".model");
String[] tokenizerFiles = new String[binFiles.length + modelFiles.length];
System.arraycopy(binFiles, 0, tokenizerFiles, 0, binFiles.length);
System.arraycopy(modelFiles, 0, tokenizerFiles, binFiles.length, modelFiles.length);
AlertDialog.Builder modelPathBuilder = new AlertDialog.Builder(this);
modelPathBuilder.setTitle("Select model path");
AlertDialog.Builder tokenizerPathBuilder = new AlertDialog.Builder(this);
Expand All @@ -134,10 +138,10 @@ private void modelDialog() {
});

tokenizerPathBuilder.setSingleChoiceItems(
binFiles,
tokenizerFiles,
-1,
(dialog, item) -> {
mTokenizerFilePath = binFiles[item];
mTokenizerFilePath = tokenizerFiles[item];
Runnable runnable =
new Runnable() {
@Override
Expand Down

0 comments on commit 0800594

Please sign in to comment.