From f79151b96ad3b69d01f6057242b8cf0e1555a046 Mon Sep 17 00:00:00 2001 From: Phil-U-U Date: Thu, 19 Oct 2023 07:13:00 +0800 Subject: [PATCH] Fix issue #2568: --device mps led to TypeError: forward() got an unexpected keyword argument 'padding_mask'. (#2579) --- fastchat/model/monkey_patch_non_inplace.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fastchat/model/monkey_patch_non_inplace.py b/fastchat/model/monkey_patch_non_inplace.py index 9661d7075..413dd3b30 100644 --- a/fastchat/model/monkey_patch_non_inplace.py +++ b/fastchat/model/monkey_patch_non_inplace.py @@ -35,6 +35,7 @@ def forward( past_key_value: Optional[Tuple[torch.Tensor]] = None, output_attentions: bool = False, use_cache: bool = False, + padding_mask: Optional[torch.LongTensor] = None, ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]: bsz, q_len, _ = hidden_states.size()