Skip to content

Commit 876395a

Browse files
Copilotkirklandsign
andcommitted
Fix "select model" message showing even when model is already loaded
Co-authored-by: kirklandsign <107070759+kirklandsign@users.noreply.github.com>
1 parent 0a0dda9 commit 876395a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo

llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/MainActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,13 @@ protected void onResume() {
381381
// If users change the model file, but not pressing loadModelButton, we won't load the new
382382
// model
383383
checkForUpdateAndReloadModel(updatedSettingsFields);
384-
} else {
384+
} else if (mModule == null) {
385+
// Only ask user to select model if no model is currently loaded
385386
askUserToSelectModel();
386387
}
387388
}
388-
} else {
389+
} else if (mModule == null) {
390+
// Only ask user to select model if no model is currently loaded
389391
askUserToSelectModel();
390392
}
391393
}

0 commit comments

Comments
 (0)