From b386eeceb26baeb4abfcc924275766f7e025dfd9 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 21 Oct 2025 14:19:01 -0700 Subject: [PATCH] Handle dataPath = null case --- .../org/pytorch/executorch/extension/llm/LlmModule.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java b/extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java index 874c0db3c03..5e080e0c369 100644 --- a/extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java +++ b/extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java @@ -70,7 +70,12 @@ public LlmModule( */ public LlmModule( int modelType, String modulePath, String tokenizerPath, float temperature, String dataPath) { - this(modelType, modulePath, tokenizerPath, temperature, List.of(dataPath)); + this( + modelType, + modulePath, + tokenizerPath, + temperature, + dataPath != null ? List.of(dataPath) : List.of()); } /** Constructs a LLM Module for a model with given model path, tokenizer, temperature. */