fix: update TopK and Score Threshold components to use InputNumber and improve value handling (#27045)

This commit is contained in:
Wu Tianwei
2025-10-17 14:58:30 +08:00
committed by GitHub
parent bfda4ce7e6
commit 64f55d55a1
2 changed files with 40 additions and 18 deletions

View File

@@ -32,7 +32,7 @@ const TopKItem: FC<Props> = ({
}) => {
const { t } = useTranslation()
const handleParamChange = (key: string, value: number) => {
let notOutRangeValue = Number.parseFloat(value.toFixed(2))
let notOutRangeValue = Number.parseInt(value.toFixed(0))
notOutRangeValue = Math.max(VALUE_LIMIT.min, notOutRangeValue)
notOutRangeValue = Math.min(VALUE_LIMIT.max, notOutRangeValue)
onChange(key, notOutRangeValue)