Skip to content

Commit 40d0d99

Browse files
add iter() to make iteration auto +1
1 parent 339dc00 commit 40d0d99

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

gptqmodel/utils/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def pack_module(name, qModules, quant_result, layers, pbar=None):
516516
qModules[name].pack(linear=layers[name], scales=scale, zeros=zero, g_idx=g_idx)
517517
qModules[name].to(layer_device)
518518
if pbar:
519-
pbar.current_iteration += 1
519+
pbar.iter()
520520
pbar.progress()
521521

522522

gptqmodel/utils/progress.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ def log(self, bar:str, log:str, padding:str = "", end: str = ""):
115115

116116
update_last_pb_instance(src=self) # let logger now we logged
117117

118+
def iter(self):
119+
self.current_iteration += 1
120+
118121
def __bool__(self):
119122
if self.total is not None:
120123
return self.total > 0

0 commit comments

Comments
 (0)