Skip to content

Commit 130e0d4

Browse files
Add reset() to Llama and basic thread detection
1 parent ca5e5e8 commit 130e0d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/myrobotlab/service/Llama.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public Llama(String reservedKey, String inId) {
3737
public void loadModel(String modelPath) {
3838
Parameters params = new Parameters.Builder()
3939
.setNGpuLayers(0)
40+
.setNThreads(java.lang.Runtime.getRuntime().availableProcessors())
4041
.setTemperature(0.7f)
4142
.setPenalizeNl(true)
4243
.setMirostat(Parameters.MiroStat.V2)
@@ -129,6 +130,11 @@ public Response publishResponse(Response response) {
129130
return response;
130131
}
131132

133+
public void reset() {
134+
model.reset();
135+
136+
}
137+
132138
public static void main(String[] args) {
133139
try {
134140

0 commit comments

Comments
 (0)