Skip to content

Commit 17e3693

Browse files
authored
Fix jni_layer_llama.cpp generate_from_pos missing return (#12066)
Summary: Fix the issue on #11952 where we are missing a return in generate_from_pos() Reviewed By: GregoryComer Differential Revision: D77456146
1 parent 85b91a4 commit 17e3693

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extension/android/jni/jni_layer_llama.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ class ExecuTorchLlmJni : public facebook::jni::HybridClass<ExecuTorchLlmJni> {
311311
.seq_len = seq_len,
312312
.temperature = temperature_,
313313
};
314-
runner_->generate_from_pos(
314+
return static_cast<jint>(runner_->generate_from_pos(
315315
prompt->toStdString(),
316316
start_pos,
317317
config,
318318
[callback](std::string result) { callback->onResult(result); },
319-
[callback](const llm::Stats& stats) { callback->onStats(stats); });
319+
[callback](const llm::Stats& stats) { callback->onStats(stats); }));
320320
}
321321
}
322322

0 commit comments

Comments
 (0)