Update model.py

This commit is contained in:
Jared Levi De La Fuente Rodriguez
2023-09-03 10:14:42 -06:00
committed by GitHub
parent 346627f6e8
commit 8432e482de

View File

@@ -448,7 +448,8 @@ class Transformer(nn.Module):
)
self.freqs_cis = precompute_freqs_cis(
# self.params.max_seq_len is multiplied by 2 because the token limit is 4096, so you can't make it bigger than that, and this is why it's set the the maximun (4096).
# Note that self.params.max_seq_len is multiplied by 2 because the token limit for the Llama 2 generation of models is 4096.
#Adding this multiplier instead of using 4096 directly allows for dynamism of token lengths while training or fine-tuning.
self.params.dim // self.params.n_heads, self.params.max_seq_len * 2
)