@@ -138,13 +138,15 @@ def from_config(cls, config: dict[str, Any]) -> "ModelOptFp8Config":
138138 if not quant_method :
139139 raise ValueError ("Missing 'quant_algo' in quantization config" )
140140 kv_cache_quant_method = quant_config .get ("kv_cache_quant_algo" )
141+ # "exclude_modules" is the key in the legacy hf_quant_config.json
141142 exclude_modules = quant_config .get ("exclude_modules" )
142143 else :
143144 # Compressed-tensors style format:
144145 # {"quant_algo": "...", "quant_method": "modelopt"}
145146 quant_method = config .get ("quant_algo" , "" )
146147 kv_cache_quant_method = config .get ("kv_cache_quant_algo" )
147- exclude_modules = config .get ("exclude_modules" )
148+ # "ignore" is the key in config.json
149+ exclude_modules = config .get ("ignore" )
148150
149151 if quant_method not in QUANT_ALGOS :
150152 raise ValueError (
@@ -723,6 +725,7 @@ def from_config(cls, config: dict[str, Any]) -> "ModelOptNvFp4Config":
723725 raise ValueError (f"group_size must be an integer, got "
724726 f"{ type (group_size_raw )} " ) from None
725727
728+ # "exclude_modules" is the key in the legacy hf_quant_config.json
726729 exclude_modules = quant_config .get ("exclude_modules" , [])
727730 if not isinstance (exclude_modules , list ):
728731 raise ValueError (f"exclude_modules must be a list, got "
@@ -756,7 +759,8 @@ def from_config(cls, config: dict[str, Any]) -> "ModelOptNvFp4Config":
756759 raise ValueError (f"group_size must be an integer, got "
757760 f"{ type (group_size_raw )} " ) from None
758761
759- exclude_modules = config .get ("exclude_modules" , [])
762+ # "ignore" is the key in config.json
763+ exclude_modules = config .get ("ignore" , [])
760764 if not isinstance (exclude_modules , list ):
761765 raise ValueError (f"exclude_modules must be a list, got "
762766 f"{ type (exclude_modules )} " )
0 commit comments