From ce9413d849f255d81528bb0bdf59f02a5d884bf7 Mon Sep 17 00:00:00 2001 From: slaren Date: Sat, 6 Apr 2024 22:33:36 +0200 Subject: [PATCH] export norms as f32 --- convert-hf-to-gguf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 7e601170e925a..37af6328a1705 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -160,7 +160,7 @@ def write_tensors(self): data = data.astype(np.float32) # TODO: Why cant we use these float16 as-is? There should be not reason to store float16 as float32 - if self.ftype == 1 and data_dtype == np.float16 and n_dims == 1: + if self.ftype == 1 and data_dtype == np.float16 and (n_dims == 1 or new_name.endswith("_norm.weight")): data = data.astype(np.float32) # if f16 desired, convert any float32 2-dim weight tensors to float16