Update llama.py
This commit is contained in:
parent
89fd58d649
commit
bbad02dc00
1 changed files with 1 additions and 1 deletions
|
|
@ -1069,7 +1069,7 @@ def CausalLM_fast_forward(fast_forward_inference):
|
|||
if labels is not None: labels = labels.to(lm_head_device)
|
||||
|
||||
# Output last hidden states without logits if asked
|
||||
if model.training and os.environ.get("UNSLOTH_RETURN_HIDDEN_STATES", "0") == "1":
|
||||
if self.training and os.environ.get("UNSLOTH_RETURN_HIDDEN_STATES", "0") == "1":
|
||||
if num_logits_to_keep != 0:
|
||||
hidden_states = hidden_states[:, -num_logits_to_keep:, :]
|
||||
return CausalLMOutputWithPast(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue