@@ -5,12 +5,6 @@ import { qwenImageQuantizationChanged, selectQwenImageQuantization } from 'featu
55import { memo , useCallback , useMemo } from 'react' ;
66import { useTranslation } from 'react-i18next' ;
77
8- const QUANTIZATION_OPTIONS : ComboboxOption [ ] = [
9- { value : 'none' , label : 'None (bf16)' } ,
10- { value : 'int8' , label : '8-bit (int8)' } ,
11- { value : 'nf4' , label : '4-bit (nf4)' } ,
12- ] ;
13-
148const isValidQuantization = ( value : string | undefined ) : value is 'none' | 'int8' | 'nf4' => {
159 return value === 'none' || value === 'int8' || value === 'nf4' ;
1610} ;
@@ -20,7 +14,16 @@ const ParamQwenImageQuantization = memo(() => {
2014 const { t } = useTranslation ( ) ;
2115 const quantization = useAppSelector ( selectQwenImageQuantization ) ;
2216
23- const value = useMemo ( ( ) => QUANTIZATION_OPTIONS . find ( ( o ) => o . value === quantization ) , [ quantization ] ) ;
17+ const options = useMemo < ComboboxOption [ ] > (
18+ ( ) => [
19+ { value : 'none' , label : t ( 'modelManager.qwenImageQuantizationNone' ) } ,
20+ { value : 'int8' , label : t ( 'modelManager.qwenImageQuantizationInt8' ) } ,
21+ { value : 'nf4' , label : t ( 'modelManager.qwenImageQuantizationNf4' ) } ,
22+ ] ,
23+ [ t ]
24+ ) ;
25+
26+ const value = useMemo ( ( ) => options . find ( ( o ) => o . value === quantization ) , [ options , quantization ] ) ;
2427
2528 const onChange = useCallback < ComboboxOnChange > (
2629 ( v ) => {
@@ -35,7 +38,7 @@ const ParamQwenImageQuantization = memo(() => {
3538 return (
3639 < FormControl minW = { 0 } flexGrow = { 1 } gap = { 2 } >
3740 < FormLabel m = { 0 } > { t ( 'modelManager.qwenImageQuantization' ) } </ FormLabel >
38- < Combobox value = { value } options = { QUANTIZATION_OPTIONS } onChange = { onChange } />
41+ < Combobox value = { value } options = { options } onChange = { onChange } />
3942 </ FormControl >
4043 ) ;
4144} ) ;
0 commit comments