From c55451620c03fc0c94bc68ec4f53ec138d55ed9d Mon Sep 17 00:00:00 2001 From: Angular2guy Date: Tue, 3 Dec 2024 15:45:07 +0100 Subject: [PATCH] feat: spring update --- backend/build.gradle | 10 +++++----- .../main/resources/application-ollama.properties | 14 ++++++++------ runOllama.sh | 1 + 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 61e993e..918e5b7 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -12,8 +12,8 @@ */ plugins { id 'java' - id 'org.springframework.boot' version '3.3.0' - id 'io.spring.dependency-management' version '1.1.4' + id 'org.springframework.boot' version '3.4.0' + id 'io.spring.dependency-management' version '1.1.6' } group = 'ch.xxx' @@ -37,13 +37,13 @@ dependencies { implementation 'org.liquibase:liquibase-core' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' - implementation 'net.javacrumbs.shedlock:shedlock-spring:5.2.0' - implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:5.2.0' + implementation 'net.javacrumbs.shedlock:shedlock-spring:6.0.1' + implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:6.0.1' implementation 'org.springframework.ai:spring-ai-pgvector-store-spring-boot-starter:1.0.0-SNAPSHOT' implementation 'org.springframework.ai:spring-ai-transformers-spring-boot-starter:1.0.0-SNAPSHOT' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'com.tngtech.archunit:archunit-junit5:1.1.0' + testImplementation 'com.tngtech.archunit:archunit-junit5:1.3.0' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' // if(project.hasProperty('useOllama')) { diff --git a/backend/src/main/resources/application-ollama.properties b/backend/src/main/resources/application-ollama.properties index 1563ce6..9970fe0 100644 --- a/backend/src/main/resources/application-ollama.properties +++ b/backend/src/main/resources/application-ollama.properties @@ -1,7 +1,7 @@ spring.ai.ollama.base-url=${OLLAMA-BASE-URL:http://localhost:11434} spring.ai.ollama.embedding.enabled=false spring.ai.embedding.transformer.enabled=true -document-token-limit=150 +document-token-limit=9000 embedding-token-limit=500 spring.liquibase.change-log=classpath:/dbchangelog/db.changelog-master-ollama.xml @@ -11,7 +11,11 @@ spring.liquibase.change-log=classpath:/dbchangelog/db.changelog-master-ollama.xm # document processing # falcon model config free production use -#spring.ai.ollama.chat.model=falcon:40b +#spring.ai.ollama.chat.model=qwen2.5:32b +spring.ai.ollama.chat.model=llama3.1:8b +spring.ai.ollama.chat.options.num-ctx=12288 +#spring.ai.embedding.transformer.onnx.modelUri=https://huggingface.co/mixedbread-ai/mxbai-embed-large-v1/tree/main/onnx/model_quantized.onnx +#spring.ai.embedding.transformer.tokenizer.uri=https://huggingface.co/mixedbread-ai/mxbai-embed-large-v1/tree/main/tokenizer.json # beluga model config only for non production/commercial use #spring.ai.ollama.chat.model=stable-beluga:13b @@ -23,8 +27,6 @@ spring.liquibase.change-log=classpath:/dbchangelog/db.changelog-master-ollama.xm #spring.ai.ollama.chat.options.num-thread=8 #spring.ai.ollama.chat.options.keep_alive=1s -#spring.ai.ollama.embedding.options.model=mxbai-embed-large:335m #test with Spring AI 1.0 - # generate code #spring.ai.ollama.chat.model=granite-code:20b #spring.ai.ollama.chat.options.num-ctx=8192 @@ -35,8 +37,8 @@ spring.liquibase.change-log=classpath:/dbchangelog/db.changelog-master-ollama.xm #spring.ai.ollama.chat.model=deepseek-coder-v2:16b #spring.ai.ollama.chat.options.num-ctx=65536 -spring.ai.ollama.chat.model=codestral:22b -spring.ai.ollama.chat.options.num-ctx=32768 +#spring.ai.ollama.chat.model=codestral:22b +#spring.ai.ollama.chat.options.num-ctx=32768 # generate book summaries spring.ai.ollama.chat.options.num-thread=8 diff --git a/runOllama.sh b/runOllama.sh index b869036..16db2bf 100644 --- a/runOllama.sh +++ b/runOllama.sh @@ -13,4 +13,5 @@ docker exec -it ollama ollama run stable-beluga:13bc #docker exec -it ollama ollama run llama3.1:70b #docker exec -it ollama ollama run qwen2.5:32b #docker exec -it ollama ollama run codestral:22b +#docker exec -it ollama ollama run llama3.1:8b #docker exec -it ollama bash \ No newline at end of file