Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mjfelis committed Nov 9, 2024
1 parent de35b9f commit 2fd890d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.github.ollama4j.models.chat.OllamaChatRequest;
import io.github.ollama4j.models.chat.OllamaChatRequestBuilder;
import io.github.ollama4j.models.chat.OllamaChatResult;
import io.github.ollama4j.models.response.LibraryModelTag;
import io.github.ollama4j.models.response.Model;
import io.github.ollama4j.types.OllamaModelType;
import io.twentysixty.ollama.hologram.chatbot.jms.OllamaProducer;
Expand Down Expand Up @@ -95,7 +96,7 @@ public String getChatResponse(List<OllamaChatMessage> messages) throws OllamaBas
OllamaAPI ollamaAPI = new OllamaAPI(serviceUrl);
ollamaAPI.setRequestTimeoutSeconds(timeout);

OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(OllamaModelType.LLAMA2);
OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance("llama3.2:1b");
OllamaChatRequest requestModel = builder.withMessages(messages).build();
OllamaChatResult chatResult = ollamaAPI.chat(requestModel);

Expand Down Expand Up @@ -129,7 +130,7 @@ private void checkModels() {
try {
models = ollamaAPI.listModels();
for (Model m: models) {
if (m.getName().startsWith("llama2:")) {
if (m.getName().startsWith("llama3.2:1b")) {
modelLoaded = true;
}
logger.info(m.getName());
Expand All @@ -142,7 +143,7 @@ private void checkModels() {
if (!modelLoaded) {
logger.info("loading model...");
try {
ollamaAPI.pullModel(OllamaModelType.LLAMA2);
ollamaAPI.pullModel("llama3.2:1b");
} catch (Exception e) {
logger.error("", e);
}
Expand Down

0 comments on commit 2fd890d

Please sign in to comment.