[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
004d8424ad
commit
cd0aee97a0
1 changed files with 4 additions and 3 deletions
|
|
@ -1153,9 +1153,10 @@ def unsloth_save_model(
|
|||
state_dict[f"model.layers.{j}.{item}.bias"] = bias
|
||||
|
||||
_dev_budget = _device_vram_budget(W.device)
|
||||
if _dev_budget is not None and (
|
||||
torch.cuda.memory_allocated(W.device) + W.nbytes
|
||||
) < _dev_budget:
|
||||
if (
|
||||
_dev_budget is not None
|
||||
and (torch.cuda.memory_allocated(W.device) + W.nbytes) < _dev_budget
|
||||
):
|
||||
# Fits on W's own GPU -> keep it there.
|
||||
state_dict[name] = W
|
||||
elif W.device.type != "cuda":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue