Update llama.py
This commit is contained in:
parent
5fe166d32e
commit
ddb48efd33
1 changed files with 1 additions and 0 deletions
|
|
@ -520,6 +520,7 @@ def LlamaModel_fast_forward(
|
|||
|
||||
# Fix up attention mask by setting elements to 0
|
||||
# Specifically for DPO
|
||||
print(self._has_no_labels, attention_mask)
|
||||
if self._has_no_labels and attention_mask is not None:
|
||||
inputs_requires_grad = hidden_states.requires_grad
|
||||
if inputs_requires_grad: hidden_states.requires_grad_(False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue