Skip to content

Commit 015a6ab

Browse files
committed
Doing some rename
1 parent efe81ee commit 015a6ab

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/LlmModule.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,14 @@ public long prefillImages(int[] image, int width, int height, int channels, long
182182
if (startPos == 0) {
183183
resetContext();
184184
}
185-
int nativeResult = prefillImagesNative(image, width, height, channels);
185+
int nativeResult = appendImagesInput(image, width, height, channels);
186186
if (nativeResult != 0) {
187187
throw new RuntimeException("Prefill failed with error code: " + nativeResult);
188188
}
189189
return 0;
190190
}
191191

192-
private native int prefillImagesNative(int[] image, int width, int height, int channels);
192+
private native int appendImagesInput(int[] image, int width, int height, int channels);
193193

194194
/**
195195
* Prefill an LLaVA Module with the given text input.
@@ -208,15 +208,15 @@ public long prefillPrompt(String prompt, long startPos, int bos, int eos) {
208208
if (startPos == 0) {
209209
resetContext();
210210
}
211-
int nativeResult = prefillPromptNative(prompt, bos, eos);
211+
int nativeResult = appendTextInput(prompt, bos, eos);
212212
if (nativeResult != 0) {
213213
throw new RuntimeException("Prefill failed with error code: " + nativeResult);
214214
}
215215
return 0;
216216
}
217217

218218
// returns a tuple of (status, updated startPos)
219-
private native int prefillPromptNative(String prompt, int bos, int eos);
219+
private native int appendTextInput(String prompt, int bos, int eos);
220220

221221
/**
222222
* Generate tokens from the given prompt, starting from the given position.

extension/android/jni/jni_layer_llama.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ class ExecuTorchLlmJni : public facebook::jni::HybridClass<ExecuTorchLlmJni> {
260260
// Returns a tuple of (error, start_pos)
261261
// Contract is valid within an AAR (JNI + corresponding Java code)
262262
// If the first element is not Error::Ok, the other element is undefined.
263-
jint prefill_prompt(
263+
jint append_text_input(
264264
facebook::jni::alias_ref<jstring> prompt,
265265
jint bos,
266266
jint eos) {
267267
prefill_inputs_.emplace_back(llm::MultimodalInput{prompt->toStdString()});
268268
return 0;
269269
}
270270

271-
jint prefill_images(
271+
jint append_images_input(
272272
facebook::jni::alias_ref<jintArray> image,
273273
jint width,
274274
jint height,
@@ -349,9 +349,9 @@ class ExecuTorchLlmJni : public facebook::jni::HybridClass<ExecuTorchLlmJni> {
349349
makeNativeMethod("stop", ExecuTorchLlmJni::stop),
350350
makeNativeMethod("load", ExecuTorchLlmJni::load),
351351
makeNativeMethod(
352-
"prefillImagesNative", ExecuTorchLlmJni::prefill_images),
352+
"appendImagesInput", ExecuTorchLlmJni::append_images_input),
353353
makeNativeMethod(
354-
"prefillPromptNative", ExecuTorchLlmJni::prefill_prompt),
354+
"appendTextInput", ExecuTorchLlmJni::append_text_input),
355355
makeNativeMethod(
356356
"generateFromPos", ExecuTorchLlmJni::generate_from_pos),
357357
makeNativeMethod("resetContext", ExecuTorchLlmJni::reset_context),

0 commit comments

Comments
 (0)