Update llama.py
This commit is contained in:
parent
3289975025
commit
6d8b4c53a5
1 changed files with 7 additions and 1 deletions
|
|
@ -958,7 +958,13 @@ def CausalLM_fast_forward(fast_forward_inference):
|
|||
else:
|
||||
logits = self.lm_head(hidden_states.to(lm_head.dtype))
|
||||
pass
|
||||
logits = logits.to(self.config.torch_dtype)
|
||||
|
||||
torch_dtype = __DTYPE_MAP.get(self.config.torch_dtype, None)
|
||||
if torch_dtype is not None:
|
||||
logits = logits.to(torch_dtype)
|
||||
else:
|
||||
raise TypeError("Unsloth: torch_dtype for models is not bfloat16, float16 or float32!")
|
||||
pass
|
||||
|
||||
loss = None
|
||||
logit_softcapping = getattr(self.config, "final_logit_softcapping", 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue