From a9dc1a945649210f73c9ca4305cf754f4391f9ef Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 3 Oct 2024 19:16:52 +0200 Subject: [PATCH] feat(llm): update ollama default parameters --- src/adapters/ollama/chat.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/adapters/ollama/chat.ts b/src/adapters/ollama/chat.ts index 7dd82402..5950fd35 100644 --- a/src/adapters/ollama/chat.ts +++ b/src/adapters/ollama/chat.ts @@ -123,21 +123,17 @@ export class OllamaChatLLM extends ChatLLM { public readonly parameters: Partial; constructor( - { - client, - modelId = "llama3.1", - parameters = { temperature: 0 }, - executionOptions = {}, - }: Input = { + { client, modelId, parameters, executionOptions = {} }: Input = { modelId: "llama3.1", - parameters: { - temperature: 0, - }, }, ) { super(modelId, executionOptions); this.client = client ?? new Client({ fetch }); - this.parameters = parameters ?? {}; + this.parameters = parameters ?? { + temperature: 0, + repeat_penalty: 1.0, + num_predict: 2048, + }; } static {