Merge pull request #5644 from menloresearch/fix/some-of-model-settings-are-not-applied

fix: some of the model settings are not applied
This commit is contained in:
Louis 2025-07-01 13:43:02 +07:00 committed by GitHub
commit 9e9bc49729
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 !== null && !isNaN(newValue)) {
return newValue
}
}
return value
}