feat: Add support for minP, repeatLastN, and repeatPenalty model settings

This commit is contained in:
n4ze3m
2024-12-28 17:38:52 +05:30
parent ef40b9a242
commit aa49f03f63
10 changed files with 209 additions and 26 deletions

View File

@@ -95,6 +95,8 @@ export class ChatOllama
topP?: number;
minP?: number;
typicalP?: number;
useMLock?: boolean;
@@ -142,6 +144,7 @@ export class ChatOllama
this.tfsZ = fields.tfsZ;
this.topK = fields.topK;
this.topP = fields.topP;
this.minP = fields.minP;
this.typicalP = fields.typicalP;
this.useMLock = fields.useMLock;
this.useMMap = fields.useMMap;
@@ -205,6 +208,7 @@ export class ChatOllama
tfs_z: this.tfsZ,
top_k: this.topK,
top_p: this.topP,
min_p: this.minP,
typical_p: this.typicalP,
use_mlock: this.useMLock,
use_mmap: this.useMMap,

View File

@@ -17,7 +17,10 @@ export const pageAssistModel = async ({
seed,
numGpu,
numPredict,
useMMap
useMMap,
minP,
repeatLastN,
repeatPenalty
}: {
model: string
baseUrl: string
@@ -30,6 +33,9 @@ export const pageAssistModel = async ({
numGpu?: number
numPredict?: number
useMMap?: boolean
minP?: number
repeatPenalty?: number
repeatLastN?: number
}) => {
if (model === "chrome::gemini-nano::page-assist") {
return new ChatChromeAI({
@@ -86,6 +92,9 @@ export const pageAssistModel = async ({
model,
numGpu,
numPredict,
useMMap
useMMap,
minP: minP,
repeatPenalty: repeatPenalty,
repeatLastN: repeatLastN,
})
}

View File

@@ -35,6 +35,7 @@ export interface OllamaInput {
tfsZ?: number
topK?: number
topP?: number
minP?: number
typicalP?: number
useMLock?: boolean
useMMap?: boolean