constrain edge value of serveWeight for llm

This commit is contained in:
geekgeekrun
2025-04-16 00:32:06 +08:00
parent 76339ebc5c
commit 94e237fee8
2 changed files with 10 additions and 2 deletions

View File

@@ -34,6 +34,14 @@ const pickLlmConfigFromList = (llmConfigList) => {
if (!llmConfigList.length) {
return null
}
llmConfigList.forEach((conf) => {
if (!Number(conf.serveWeight) || conf.serveWeight < 1) {
conf.serveWeight = 1
}
if (conf.serveWeight > 100) {
conf.serveWeight = 100
}
})
const pool: number[] = []
for (let i = 0; i < llmConfigList.length; i++) {
for (let j = 0; j < Math.floor(llmConfigList[i].serveWeight); j++) {

View File

@@ -188,13 +188,13 @@
<el-input-number
v-if="formContent.length > 1"
v-model="conf.serveWeight"
:min="0"
:min="1"
:max="100"
:step="1"
step-strictly
:precision="0"
font-size-12px
placeholder="0 ~ 100"
placeholder="1 ~ 100"
@change="
(new_val, old_val) => {
gtagRenderer('serve_weight_changed', { new_val, old_val })