Skip to content

Commit

Permalink
export norms as f32
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren committed Apr 6, 2024
1 parent 26e8f23 commit ce9413d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce9413d

Please sign in to comment.