Skip to content

Commit 342213e

Browse files
authored
Android app clear context when resetting history (#119)
1 parent 8b5caf0 commit 342213e

1 file changed

Lines changed: 5 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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ private void setLocalModel(
212212
}
213213
} catch (ExecutorchRuntimeException e) {
214214
modelInfo = e.getMessage() + "\n";
215-
String errorLog = e.getDetailedError();
216-
ETLogging.getInstance().log("Error while loading model " + errorLog);
215+
// String errorLog = e.getDetailedError();
216+
// ETLogging.getInstance().log("Error while loading model " + errorLog);
217217

218218
loadDuration = 0;
219219
AlertDialog.Builder builder = new AlertDialog.Builder(this);
@@ -414,6 +414,9 @@ private void checkForClearChatHistory(SettingsFields updatedSettingsFields) {
414414
// changing to false since chat history has been cleared.
415415
updatedSettingsFields.saveIsClearChatHistory(false);
416416
mDemoSharedPreferences.addSettings(updatedSettingsFields);
417+
if (mModule != null) {
418+
mModule.resetContext();
419+
}
417420
}
418421
}
419422

0 commit comments

Comments
 (0)