From e42ec8ba4d223246367794326d010cedc604fed3 Mon Sep 17 00:00:00 2001 From: Siddartha Pothapragada Date: Tue, 21 Apr 2026 09:47:49 -0700 Subject: [PATCH] Fix SanityCheck: adapt to LlmModule.load() void return MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LlmModule.load() now returns void and throws ExecutorchRuntimeException on failure (changed in pytorch/executorch#18669). Remove the return value capture and assertEquals check — a successful load() call without exception is the assertion. This commit was authored with the help of Claude. --- .../java/com/example/executorchllamademo/SanityCheck.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/llm/android/LlamaDemo/app/src/androidTest/java/com/example/executorchllamademo/SanityCheck.kt b/llm/android/LlamaDemo/app/src/androidTest/java/com/example/executorchllamademo/SanityCheck.kt index 9b32090933..5662102e74 100644 --- a/llm/android/LlamaDemo/app/src/androidTest/java/com/example/executorchllamademo/SanityCheck.kt +++ b/llm/android/LlamaDemo/app/src/androidTest/java/com/example/executorchllamademo/SanityCheck.kt @@ -11,7 +11,6 @@ package com.example.executorchllamademo import android.util.Log import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Before import org.junit.Test @@ -56,9 +55,7 @@ class SanityCheck : LlmCallback { val model = File(RESOURCE_PATH + modelFile) val module = LlmModule(model.path, tokenizerPath, 0.8f) - val loadResult = module.load() - // Check that the model can be loaded successfully - assertEquals(0, loadResult) + module.load() // Run a testing prompt module.generate("How do you do! I'm testing llm on mobile device", this)