Skip to content

Commit 838df68

Browse files
n1ck-guochensuyue
authored andcommitted
fix bug of q_layer_inputs (#811)
Signed-off-by: n1ck-guo <[email protected]> (cherry picked from commit e1ae6e9)
1 parent 0ea51af commit 838df68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

auto_round/autoround.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ def _quantize_layers(self, layer_names: list, layer_inputs: dict) -> None:
18941894
for layer_name in layer_names:
18951895
layer_input = layer_inputs[layer_name]
18961896
layer_input = to_device(layer_input, self.cache_device)
1897-
q_layer_input = q_layer_inputs[layer_name] if q_layer_inputs is not None else None
1897+
q_layer_input = q_layer_inputs.get(layer_name, None) if q_layer_inputs is not None else None
18981898
q_layer_input = to_device(q_layer_input, self.cache_device)
18991899
quant_layer(layer_name, layer_input, q_layer_input, device=self.device)
19001900
del layer_input

0 commit comments

Comments
 (0)