Skip to content

Commit

Permalink
Account for not having quantized weights
Browse files Browse the repository at this point in the history
  • Loading branch information
city96 committed Dec 22, 2024
1 parent 51fa2cb commit c6ad4f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def gguf_sd_loader(path, handle_prefix="model.diffusion_model.", return_arch=Fal

# mark largest tensor for vram estimation
qsd = {k:v for k,v in state_dict.items() if is_quantized(v)}
max_key = max(qsd.keys(), key=lambda k: qsd[k].numel())
state_dict[max_key].is_largest_weight = True
if len(qsd) > 0:
max_key = max(qsd.keys(), key=lambda k: qsd[k].numel())
state_dict[max_key].is_largest_weight = True

# sanity check debug print
print("\nggml_sd_loader:")
Expand Down

0 comments on commit c6ad4f2

Please sign in to comment.