Skip to content

Commit 48f568d

Browse files
metascroyJack-Khuu
andcommitted
Update torchchat/utils/quantize.py
Co-authored-by: Jack-Khuu <[email protected]>
1 parent 74363e4 commit 48f568d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

torchchat/utils/quantize.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ def quantize_model(
137137
group_size = q_kwargs["groupsize"]
138138
bit_width = q_kwargs["bitwidth"]
139139
has_weight_zeros = q_kwargs["has_weight_zeros"]
140-
granularity = PerRow()
141-
if group_size != -1:
142-
granularity = PerGroup(group_size)
140+
granularity = PerRow() if group_size == -1 else PerGroup(group_size)
143141
weight_dtype = getattr(torch, f"int{bit_width}")
144142

145143
try:

0 commit comments

Comments
 (0)