Update modeling_chatglm.py
Browse files- 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
|
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,
|