From a092d1f4825de9e37874960206e6b484002c6083 Mon Sep 17 00:00:00 2001 From: shirosaki-hana Date: Tue, 17 Dec 2024 11:30:16 +0900 Subject: [PATCH] =?UTF-8?q?Fixed=20=E2=80=9CSeparate=20Parameters=E2=80=9D?= =?UTF-8?q?=20scaling=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed an issue where the “Temperature” parameter was not scaled correctly when using the “Separate Parameters” feature. --- src/ts/process/request.ts | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/ts/process/request.ts b/src/ts/process/request.ts index adb27280..3fc63ce4 100644 --- a/src/ts/process/request.ts +++ b/src/ts/process/request.ts @@ -105,11 +105,46 @@ function applyParameters(data: { [key: string]: any }, parameters: Parameter[], } for(const parameter of parameters){ + + let value = 0 if(parameter === 'top_k' && arg.ignoreTopKIfZero && db.seperateParameters[ModelMode][parameter] === 0){ continue } - let value = db.seperateParameters[ModelMode][parameter] + switch(parameter){ + case 'temperature':{ + value = db.seperateParameters[ModelMode].temperature === -1000 ? -1000 : (db.seperateParameters[ModelMode].temperature / 100) + break + } + case 'top_k':{ + value = db.seperateParameters[ModelMode].top_k + break + } + case 'repetition_penalty':{ + value = db.seperateParameters[ModelMode].repetition_penalty + break + } + case 'min_p':{ + value = db.seperateParameters[ModelMode].min_p + break + } + case 'top_a':{ + value = db.seperateParameters[ModelMode].top_a + break + } + case 'top_p':{ + value = db.seperateParameters[ModelMode].top_p + break + } + case 'frequency_penalty':{ + value = db.seperateParameters[ModelMode].frequency_penalty === -1000 ? -1000 : (db.seperateParameters[ModelMode].frequency_penalty / 100) + break + } + case 'presence_penalty':{ + value = db.seperateParameters[ModelMode].presence_penalty === -1000 ? -1000 : (db.seperateParameters[ModelMode].presence_penalty / 100) + break + } + } if(value === -1000 || value === undefined){ continue