PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
fix bug of quantizing Z-image (#1516)
Xin He8a404ec0fb16
diff --git a/auto_round/compressors/shard_writer.py b/auto_round/compressors/shard_writer.pyindex 39964319a..62362bff3 100644--- a/auto_round/compressors/shard_writer.py+++ b/auto_round/compressors/shard_writer.py@@ -148,7 +148,11 @@ class ShardWriter:module = get_module(self.model, module_path)# Check if all parameters of this module are now in 'all_saved'- if module is not None and all(f"{module_path}.{k}" in all_saved for k in module.state_dict().keys()):+ if (+ module is not None+ and isinstance(module, torch.nn.Module)+ and all(f"{module_path}.{k}" in all_saved for k in module.state_dict().keys())+ ):module.to("meta")def finalize(self):