Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions web/utils/componentSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,31 @@
const keySetting = settings[key as keyof typeof settings]

if (!componentSetting) {
return

Check warning on line 16 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

16 line is not covered with tests
}
if ('slider' === componentSetting.controllerType) {
const value = Number(keySetting)
if ('value' in componentSetting.controllerProps) {
componentSetting.controllerProps.value = value
if ('max' in componentSetting.controllerProps) {
switch (key) {

Check warning on line 23 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

19-23 lines are not covered with tests
case 'max_tokens':
componentSetting.controllerProps.max =

Check warning on line 25 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

25 line is not covered with tests
selectedModel?.parameters.max_tokens ||
componentSetting.controllerProps.max ||
4096
break

Check warning on line 29 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

29 line is not covered with tests
case 'ctx_len':
componentSetting.controllerProps.max =

Check warning on line 31 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

31 line is not covered with tests
selectedModel?.settings.ctx_len ||
componentSetting.controllerProps.max ||
2048
break

Check warning on line 35 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

35 line is not covered with tests
case 'ngl':
componentSetting.controllerProps.max =

Check warning on line 37 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

37 line is not covered with tests
selectedModel?.settings.ngl ||
componentSetting.controllerProps.max ||
100
}
}
}
Expand Down Expand Up @@ -62,9 +67,9 @@
const checked = keySetting as boolean
if ('value' in componentSetting.controllerProps)
componentSetting.controllerProps.value = checked
} else if ('tag' === componentSetting.controllerType) {
if ('value' in componentSetting.controllerProps)
componentSetting.controllerProps.value = keySetting as string

Check warning on line 72 in web/utils/componentSettings.ts

View workflow job for this annotation

GitHub Actions / coverage-check

70-72 lines are not covered with tests
}
componentData.push(componentSetting)
})
Expand Down
Loading