Skip to content

Commit 265529f

Browse files
Fix g_idx init for GPTQ (#2222)
Signed-off-by: Kaihui-intel <[email protected]> Co-authored-by: Wang, Chang <[email protected]>
1 parent 5a3a62d commit 265529f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neural_compressor/transformers/models/modeling_auto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
def build_woq_model(model, quantization_config):
6262
bits = quantization_config.bits
63+
g_idx = getattr(quantization_config, "desc_act", False)
6364
for n, m in model.named_modules():
6465
if n in quantization_config.modules_to_not_convert:
6566
continue
@@ -70,7 +71,6 @@ def build_woq_model(model, quantization_config):
7071
not getattr(quantization_config, "sym", False),
7172
)
7273
use_optimum_format = True
73-
g_idx = hasattr(m, "g_idx") and m.g_idx is not None
7474

7575
with init_empty_weights():
7676
new_module = INCWeightOnlyLinear(

0 commit comments

Comments
 (0)