Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions neural_compressor/torch/algorithms/weight_only/awq.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ def block_inference(self, model):
"""
total_out = []
for args, kwargs in zip(self.total_block_args, self.total_block_kwargs):
# to avoid layer_past: Dynamic_cache when transformers higher than 4.45.1
if "layer_past" in kwargs.keys() and kwargs["layer_past"] is not None:
kwargs["layer_past"] = None
out = model(*args, **kwargs)
if isinstance(out, tuple): # pragma: no cover
out = out[0]
Expand Down
Loading