Skip to content

Commit 6fb61e3

Browse files
committed
remove jetbrains annotations
1 parent fffa31b commit 6fb61e3

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@
5656
<version>${junit.version}</version>
5757
<scope>test</scope>
5858
</dependency>
59-
<dependency>
60-
<groupId>org.jetbrains</groupId>
61-
<artifactId>annotations</artifactId>
62-
<version>24.1.0</version>
63-
<scope>compile</scope>
64-
</dependency>
6559
</dependencies>
6660

6761
<build>

src/main/java/de/kherud/llama/LlamaIterable.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package de.kherud.llama;
22

3-
import org.jetbrains.annotations.NotNull;
4-
53
/**
64
* An iterable used by {@link LlamaModel#generate(InferenceParameters)} that specifically returns a {@link LlamaIterator}.
75
*/
86
@FunctionalInterface
97
public interface LlamaIterable extends Iterable<LlamaOutput> {
108

11-
@NotNull
129
@Override
1310
LlamaIterator iterator();
1411

src/main/java/de/kherud/llama/LlamaLoader.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import java.util.List;
2929
import java.util.stream.Stream;
3030

31-
import org.jetbrains.annotations.Nullable;
32-
3331
/**
3432
* Set the system properties, de.kherud.llama.lib.path, de.kherud.llama.lib.name, appropriately so that the
3533
* library can find *.dll, *.dylib and *.so files, according to the current OS (win, linux, mac).
@@ -186,7 +184,6 @@ private static boolean loadNativeLibrary(Path path) {
186184
}
187185
}
188186

189-
@Nullable
190187
private static Path extractFile(String sourceDirectory, String fileName, String targetDirectory, boolean addUuid) {
191188
String nativeLibraryFilePath = sourceDirectory + "/" + fileName;
192189

src/main/java/de/kherud/llama/LlamaModel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.kherud.llama;
22

33
import de.kherud.llama.args.LogFormat;
4-
import org.jetbrains.annotations.Nullable;
54

65
import java.lang.annotation.Native;
76
import java.nio.charset.StandardCharsets;
@@ -106,9 +105,9 @@ public String decode(int[] tokens) {
106105
* To disable logging, pass an empty callback, i.e., <code>(level, msg) -> {}</code>.
107106
*
108107
* @param format the log format to use
109-
* @param callback a method to call for log messages
108+
* @param callback a method to call for log messages (can be set to null)
110109
*/
111-
public static native void setLogger(LogFormat format, @Nullable BiConsumer<LogLevel, String> callback);
110+
public static native void setLogger(LogFormat format, BiConsumer<LogLevel, String> callback);
112111

113112
@Override
114113
public void close() {

src/main/java/de/kherud/llama/LlamaOutput.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package de.kherud.llama;
22

3-
import org.jetbrains.annotations.NotNull;
4-
53
import java.nio.charset.StandardCharsets;
64
import java.util.Map;
75

@@ -13,20 +11,19 @@ public final class LlamaOutput {
1311

1412
/**
1513
* The last bit of generated text that is representable as text (i.e., cannot be individual utf-8 multibyte code
16-
* points).
14+
* points). Not null.
1715
*/
18-
@NotNull
1916
public final String text;
2017

2118
/**
22-
* Note, that you have to configure {@link InferenceParameters#setNProbs(int)} in order for probabilities to be returned.
19+
* Note, that you have to configure {@link InferenceParameters#setNProbs(int)} in order for probabilities to be
20+
* returned. Not null.
2321
*/
24-
@NotNull
2522
public final Map<String, Float> probabilities;
2623

2724
final boolean stop;
2825

29-
LlamaOutput(byte[] generated, @NotNull Map<String, Float> probabilities, boolean stop) {
26+
LlamaOutput(byte[] generated, Map<String, Float> probabilities, boolean stop) {
3027
this.text = new String(generated, StandardCharsets.UTF_8);
3128
this.probabilities = probabilities;
3229
this.stop = stop;

src/test/java/de/kherud/llama/LlamaModelTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.kherud.llama;
22

33
import java.io.*;
4-
import java.nio.charset.StandardCharsets;
54
import java.util.*;
65
import java.util.regex.Pattern;
76

0 commit comments

Comments
 (0)