mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-12 16:01:38 +08:00
constrain edge value of serveWeight for llm
This commit is contained in:
@@ -34,6 +34,14 @@ const pickLlmConfigFromList = (llmConfigList) => {
|
|||||||
if (!llmConfigList.length) {
|
if (!llmConfigList.length) {
|
||||||
return null
|
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[] = []
|
const pool: number[] = []
|
||||||
for (let i = 0; i < llmConfigList.length; i++) {
|
for (let i = 0; i < llmConfigList.length; i++) {
|
||||||
for (let j = 0; j < Math.floor(llmConfigList[i].serveWeight); j++) {
|
for (let j = 0; j < Math.floor(llmConfigList[i].serveWeight); j++) {
|
||||||
|
|||||||
@@ -188,13 +188,13 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-if="formContent.length > 1"
|
v-if="formContent.length > 1"
|
||||||
v-model="conf.serveWeight"
|
v-model="conf.serveWeight"
|
||||||
:min="0"
|
:min="1"
|
||||||
:max="100"
|
:max="100"
|
||||||
:step="1"
|
:step="1"
|
||||||
step-strictly
|
step-strictly
|
||||||
:precision="0"
|
:precision="0"
|
||||||
font-size-12px
|
font-size-12px
|
||||||
placeholder="0 ~ 100"
|
placeholder="1 ~ 100"
|
||||||
@change="
|
@change="
|
||||||
(new_val, old_val) => {
|
(new_val, old_val) => {
|
||||||
gtagRenderer('serve_weight_changed', { new_val, old_val })
|
gtagRenderer('serve_weight_changed', { new_val, old_val })
|
||||||
|
|||||||
Reference in New Issue
Block a user