Skip to content

Commit 2e9ae2b

Browse files
committed
lint
1 parent 6563797 commit 2e9ae2b

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

extension/android/src/main/java/org/pytorch/executorch/LlamaCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Callback interface for Llama model. Users can implement this interface to receive the generated
1515
* tokens and statistics.
1616
*
17-
* Note: deprecated! Please use {@link org.pytorch.executorch.extension.llm.LlmCallback} instead.
17+
* <p>Note: deprecated! Please use {@link org.pytorch.executorch.extension.llm.LlmCallback} instead.
1818
*/
1919
@Deprecated
2020
public interface LlamaCallback {

extension/android/src/main/java/org/pytorch/executorch/LlamaModule.java

+21-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
package org.pytorch.executorch;
1010

11-
import org.pytorch.executorch.extension.llm.LlmModule;
1211
import org.pytorch.executorch.extension.llm.LlmCallback;
12+
import org.pytorch.executorch.extension.llm.LlmModule;
1313

1414
/**
1515
* LlamaModule is a wrapper around the Executorch Llama model. It provides a simple interface to
1616
* generate text from the model.
1717
*
18-
* Note: deprecated! Please use {@link org.pytorch.executorch.extension.llm.LlmModule} instead.
18+
* <p>Note: deprecated! Please use {@link org.pytorch.executorch.extension.llm.LlmModule} instead.
1919
*/
2020
@Deprecated
2121
public class LlamaModule {
@@ -114,7 +114,14 @@ public int generate(
114114
int seqLen,
115115
LlamaCallback llamaCallback,
116116
boolean echo) {
117-
return mModule.generate(image, width, height, channels, prompt, seqLen, new LlmCallback() {
117+
return mModule.generate(
118+
image,
119+
width,
120+
height,
121+
channels,
122+
prompt,
123+
seqLen,
124+
new LlmCallback() {
118125
@Override
119126
public void onResult(String result) {
120127
llamaCallback.onResult(result);
@@ -124,8 +131,9 @@ public void onResult(String result) {
124131
public void onStats(float tps) {
125132
llamaCallback.onStats(tps);
126133
}
127-
}, echo);
128-
}
134+
},
135+
echo);
136+
}
129137

130138
/**
131139
* Prefill an LLaVA Module with the given images input.
@@ -169,7 +177,11 @@ public long prefillPrompt(String prompt, long startPos, int bos, int eos) {
169177
*/
170178
public int generateFromPos(
171179
String prompt, int seqLen, long startPos, LlamaCallback callback, boolean echo) {
172-
return mModule.generateFromPos(prompt, seqLen, startPos, new LlmCallback() {
180+
return mModule.generateFromPos(
181+
prompt,
182+
seqLen,
183+
startPos,
184+
new LlmCallback() {
173185
@Override
174186
public void onResult(String result) {
175187
callback.onResult(result);
@@ -179,8 +191,9 @@ public void onResult(String result) {
179191
public void onStats(float tps) {
180192
callback.onStats(tps);
181193
}
182-
}, echo);
183-
}
194+
},
195+
echo);
196+
}
184197

185198
/** Stop current generate() before it finishes. */
186199
public void stop() {

0 commit comments

Comments
 (0)