From f35c52bc9fe6ef289209c1173461bb32617e2bc5 Mon Sep 17 00:00:00 2001 From: Gaurav Sarkar <60139335+Gaurav7888@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:58:25 +0530 Subject: [PATCH] Update optimum/habana/transformers/models/mt5/modeling_mt5.py Co-authored-by: Yaser Afshar --- optimum/habana/transformers/models/mt5/modeling_mt5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimum/habana/transformers/models/mt5/modeling_mt5.py b/optimum/habana/transformers/models/mt5/modeling_mt5.py index 48e2b1a9ee..443f0dfc18 100644 --- a/optimum/habana/transformers/models/mt5/modeling_mt5.py +++ b/optimum/habana/transformers/models/mt5/modeling_mt5.py @@ -477,7 +477,7 @@ def gaudi_MT5Stack_forward( # layer_outputs is a tuple with: # hidden-states, key-value-states, (self-attention position bias), (self-attention weights), (cross-attention position bias), (cross-attention weights) - if use_cache is False: + if not use_cache: layer_outputs = layer_outputs[:1] + (None,) + layer_outputs[1:] hidden_states, present_key_value_state = layer_outputs[:2]