Skip to content

Commit 572f102

Browse files
authored
[dflash] Add BF16 support to GGUF loader (#20705)
1 parent 8965e51 commit 572f102

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

extension/llm/export/gguf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ def iter_gguf(
380380
yield tensor.name, flat.view(torch.float16).reshape(shape).to(
381381
torch.bfloat16
382382
)
383+
elif tensor.tensor_type == GGMLQuantizationType.BF16:
384+
yield tensor.name, flat.view(torch.bfloat16).reshape(shape).clone()
383385
else:
384386
raise ValueError(f"Unsupported GGUF quant type: {tensor.tensor_type}")
385387

0 commit comments

Comments
 (0)