Update _utils.py
This commit is contained in:
parent
9f89844a81
commit
ac5f2b33dc
1 changed files with 3 additions and 1 deletions
|
|
@ -986,7 +986,9 @@ def _unsloth_pre_compute_loss(self, model, inputs, *args, **kwargs):
|
|||
"Read more on gradient accumulation issues here: https://unsloth.ai/blog/gradient"
|
||||
)
|
||||
pass
|
||||
return self._old_compute_loss(model, inputs, *args, **kwargs)
|
||||
with torch.autocast(device_type = "cuda", dtype = torch.float32):
|
||||
outputs = self._old_compute_loss(model, inputs, *args, **kwargs)
|
||||
return outputs
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue