fix: some of the model settings are not applied

This commit is contained in:
Louis 2025-07-01 13:17:32 +07:00
parent 1e8c9956cd
commit 7b22ba8c54
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

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