Update llama.py
This commit is contained in:
parent
29b6901cef
commit
48ded877f1
1 changed files with 1 additions and 1 deletions
|
|
@ -664,7 +664,7 @@ def LlamaModel_fast_forward(
|
|||
|
||||
# Fix up attention mask by setting elements to 0
|
||||
# Specifically for DPO
|
||||
if self._has_no_labels and (attention_mask is not None) and (past_key_values is None) and \
|
||||
if getattr(self, "_has_no_labels", False) is True and (attention_mask is not None) and (past_key_values is None) and \
|
||||
(not train_embed_tokens):
|
||||
# Careful for inference the attention_mask is size (1, kv_seq_len)
|
||||
# Whilst the input_embeds is size (1, 1, 4096)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue