mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-16 11:27:03 +00:00
convert-hf : allow converting the weird BitNet 1.3B
Its FFN size is 5460 which is not convenient. The offending tensors are kept in F16, which makes the final model 5.01 bpw.
This commit is contained in:
@@ -126,6 +126,10 @@ def quantize_q8_0(data: np.ndarray):
|
||||
__q1_3_block_size, __q1_3_type_size = GGML_QUANT_SIZES[GGMLQuantizationType.Q1_3]
|
||||
|
||||
|
||||
def can_quantize_to_q1_3(n: np.ndarray) -> bool:
|
||||
return n.shape[-1] % __q1_3_block_size == 0
|
||||
|
||||
|
||||
def __quantize_q1_3_shape_change(s: tuple[int, ...]) -> tuple[int, ...]:
|
||||
return (*s[:-1], s[-1] // __q1_3_block_size * __q1_3_type_size)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user