Upload InternLM2ForCausalLM
Browse files- modeling_internlm2.py +1 -1
modeling_internlm2.py
CHANGED
@@ -390,7 +390,7 @@ class InternLM2Attention(nn.Module):
|
|
390 |
# attn_weights_i = attn_weights_i + causal_mask_i
|
391 |
|
392 |
# # Upcast attention to fp32 and apply softmax
|
393 |
-
# attn_weights_i =
|
394 |
# attn_output_i = torch.matmul(attn_weights_i, value_states.to(device))
|
395 |
|
396 |
# return attn_output_i
|
|
|
390 |
# attn_weights_i = attn_weights_i + causal_mask_i
|
391 |
|
392 |
# # Upcast attention to fp32 and apply softmax
|
393 |
+
# attn_weights_i = nn.functional.softmax(attn_weights_i, dim=-1, dtype=torch.float32).to(query_states_i.dtype)
|
394 |
# attn_output_i = torch.matmul(attn_weights_i, value_states.to(device))
|
395 |
|
396 |
# return attn_output_i
|