ybelkada commited on
Commit
9821c13
·
1 Parent(s): 983a8b7

Update modeling_chatglm.py

Browse files
Files changed (1) hide show
  1. modeling_chatglm.py +1 -2
modeling_chatglm.py CHANGED
@@ -860,11 +860,10 @@ class ChatGLMModel(ChatGLMPreTrainedModel):
860
 
861
  all_self_attentions = None
862
  all_hidden_states = () if output_hidden_states else None
863
- for index in range(self.num_layers):
864
  if output_hidden_states:
865
  all_hidden_states = all_hidden_states + (hidden_states,)
866
 
867
- layer = self._get_layer(index)
868
  if self.gradient_checkpointing and self.training:
869
  layer_ret = torch.utils.checkpoint.checkpoint(
870
  layer,
 
860
 
861
  all_self_attentions = None
862
  all_hidden_states = () if output_hidden_states else None
863
+ for index, layer in enumerate(self.layers):
864
  if output_hidden_states:
865
  all_hidden_states = all_hidden_states + (hidden_states,)
866
 
 
867
  if self.gradient_checkpointing and self.training:
868
  layer_ret = torch.utils.checkpoint.checkpoint(
869
  layer,