refactor: Parse keepAlive value in OllamaEmbeddingsPageAssist

This commit is contained in:
n4ze3m
2024-05-23 11:22:46 +05:30
parent b3a455382c
commit fadf736f70
3 changed files with 15 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ export interface OllamaInput {
f16KV?: boolean;
frequencyPenalty?: number;
headers?: Record<string, string>;
keepAlive?: string;
keepAlive?: any;
logitsAll?: boolean;
lowVram?: boolean;
mainGpu?: number;
@@ -198,4 +198,12 @@ export async function* createOllamaChatStream(
options: OllamaCallOptions
): AsyncGenerator<OllamaChatGenerationChunk> {
yield* createOllamaStream(`${baseUrl}/api/chat`, params, options);
}
export const parseKeepAlive = (keepAlive: any) => {
if (keepAlive === "-1") {
return -1
}
return keepAlive
}