From 7b22ba8c5406712035d37cfa6a0d200f749d4341 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 1 Jul 2025 13:17:32 +0700 Subject: [PATCH 1/2] fix: some of the model settings are not applied --- core/src/browser/models/utils.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/src/browser/models/utils.ts b/core/src/browser/models/utils.ts index d3fe0cb01..6f8e106c4 100644 --- a/core/src/browser/models/utils.ts +++ b/core/src/browser/models/utils.ts @@ -50,6 +50,22 @@ export const normalizeValue = (key: string, value: any) => { // Convert to integer return Math.floor(Number(value)) } + if ( + key === 'temperature' || + key === 'top_k' || + key === 'top_p' || + key === 'min_p' || + key === 'repeat_penalty' || + key === 'frequency_penalty' || + key === 'presence_penalty' || + key === 'repeat_last_n' + ) { + // Convert to float + const newValue = parseFloat(value) + if (newValue && !isNaN(newValue)) { + return newValue + } + } return value } From db74f2cf3f8eb7734e049dc7ea1a52de508da1c4 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 1 Jul 2025 13:28:30 +0700 Subject: [PATCH 2/2] fix: check newValue not null --- core/src/browser/models/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/browser/models/utils.ts b/core/src/browser/models/utils.ts index 6f8e106c4..cb1baacd7 100644 --- a/core/src/browser/models/utils.ts +++ b/core/src/browser/models/utils.ts @@ -62,7 +62,7 @@ export const normalizeValue = (key: string, value: any) => { ) { // Convert to float const newValue = parseFloat(value) - if (newValue && !isNaN(newValue)) { + if (newValue !== null && !isNaN(newValue)) { return newValue } }