Small test and typing fixes (#3078)

* test_weights: add modules_to_not_convert

* More typing fixes
This commit is contained in:
Daniël de Kok 2025-03-10 15:08:23 +01:00 committed by GitHub
parent cae0cbe87d
commit c5ecc7a4de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -25,6 +25,7 @@ def gptq_weights_loader():
quant_method="gptq", quant_method="gptq",
quantize="gptq", quantize="gptq",
sym=True, sym=True,
modules_to_not_convert=[],
) )
@ -37,6 +38,7 @@ def gptq_weights_loader_awq():
quant_method="awq", quant_method="awq",
quantize="awq", quantize="awq",
sym=True, sym=True,
modules_to_not_convert=[],
) )

View File

@ -188,8 +188,6 @@ class GPTQWeightsLoader(WeightsLoader):
def is_layer_skipped_quantization( def is_layer_skipped_quantization(
self, prefix: str, modules_to_not_convert: List[str] self, prefix: str, modules_to_not_convert: List[str]
): ):
if modules_to_not_convert is None:
return False
return any(module_name in prefix for module_name in modules_to_not_convert) return any(module_name in prefix for module_name in modules_to_not_convert)
def get_weights_col_packed( def get_weights_col_packed(

View File

@ -21,7 +21,7 @@ class _QuantizerConfig:
quant_method: str quant_method: str
sym: bool sym: bool
weight_block_size: Optional[List[int]] weight_block_size: Optional[List[int]]
modules_to_not_convert: Optional[List[str]] modules_to_not_convert: List[str]
@dataclass @dataclass
@ -52,7 +52,7 @@ def _get_quantizer_config(model_id, revision):
sym = False sym = False
desc_act = False desc_act = False
weight_block_size = None weight_block_size = None
modules_to_not_convert = None modules_to_not_convert = []
filename = "config.json" filename = "config.json"
try: try: