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:
commit
9e9bc49729
@ -50,6 +50,22 @@ export const normalizeValue = (key: string, value: any) => {
|
|||||||
// Convert to integer
|
// Convert to integer
|
||||||
return Math.floor(Number(value))
|
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
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user