mirror of
https://github.com/deepseek-ai/DeepSeek-V3.git
synced 2025-05-02 00:19:01 -04:00
Update model.py
Enabling mixed precision training to reduce memory usage and potentially speed up training.
This commit is contained in:
parent
b5d872ead0
commit
2bf4595d13
@ -777,6 +777,7 @@ class Transformer(nn.Module):
|
||||
Returns:
|
||||
torch.Tensor: Logits tensor of shape (batch_size, vocab_size).
|
||||
"""
|
||||
with autocast():
|
||||
seqlen = tokens.size(1)
|
||||
h = self.embed(tokens)
|
||||
freqs_cis = self.freqs_cis[start_pos:start_pos+seqlen]
|
||||
|
Loading…
Reference in New Issue
Block a user