feat: support config top max value by env (#12375)
This commit is contained in:
parent
455b0cd696
commit
3b8f6233b0
6 changed files with 47 additions and 54 deletions
|
|
@ -11,11 +11,17 @@ type Props = {
|
|||
enable: boolean
|
||||
}
|
||||
|
||||
const maxTopK = (() => {
|
||||
const configValue = parseInt(globalThis.document?.body?.getAttribute('data-public-top-k-max-value') || '', 10)
|
||||
if (configValue && !isNaN(configValue))
|
||||
return configValue
|
||||
return 10
|
||||
})()
|
||||
const VALUE_LIMIT = {
|
||||
default: 2,
|
||||
step: 1,
|
||||
min: 1,
|
||||
max: 10,
|
||||
max: maxTopK,
|
||||
}
|
||||
|
||||
const key = 'top_k'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue