Skip to content

Commit 5ad35e1

Browse files
committed
fix use cache
Signed-off-by: yiliu30 <[email protected]>
1 parent 67dba40 commit 5ad35e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

auto_round/utils/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,5 +308,8 @@ def normalize_input(decoding_layer_inputs: list[tuple[Any]]) -> Tuple[List[torch
308308
input_ids.append(cur_inp[0][0][0])
309309
for key, val in cur_inp[0][1].items():
310310
input_others[key] = val
311-
311+
# Force 'use_cache' to be False
312+
if "use_cache" in input_others and input_others["use_cache"] is True:
313+
logger.warning_once("Forcing 'use_cache' to be False during calibration.")
314+
input_others["use_cache"] = False
312315
return input_ids, input_others

0 commit comments

Comments
 (0)