Update llama.py
This commit is contained in:
parent
8098b3d7b7
commit
9ac3754fcf
1 changed files with 2 additions and 0 deletions
|
|
@ -1130,7 +1130,9 @@ def CausalLM_fast_forward(fast_forward_inference):
|
|||
# Output last hidden states without logits if asked
|
||||
if os.environ.get("UNSLOTH_RETURN_HIDDEN_STATES", "0") == "1":
|
||||
if num_logits_to_keep != 0:
|
||||
print("llama 1133 hidden_states", hidden_states.shape)
|
||||
hidden_states = hidden_states[:, -num_logits_to_keep:, :]
|
||||
print("llama 1133 hidden_states", hidden_states.shape)
|
||||
return CausalLMOutputWithPast(
|
||||
loss = None,
|
||||
logits = hidden_states,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue