Nechba commited on
Commit
6877f84
·
verified ·
1 Parent(s): a7473f9

Update modeling_chatglm.py

Browse files
Files changed (1) hide show
  1. modeling_chatglm.py +2 -0
modeling_chatglm.py CHANGED
@@ -762,6 +762,8 @@ class GLMTransformer(torch.nn.Module):
762
  ):
763
  if not kv_caches:
764
  kv_caches = [None for _ in range(self.num_layers)]
 
 
765
  presents = () if use_cache else None
766
  if self.gradient_checkpointing and self.training:
767
  if use_cache:
 
762
  ):
763
  if not kv_caches:
764
  kv_caches = [None for _ in range(self.num_layers)]
765
+ else:
766
+ kv_caches=kv_caches[1]
767
  presents = () if use_cache else None
768
  if self.gradient_checkpointing and self.training:
769
  if use_cache: