From cda0780ce693e165c4572ce2f19377be9b7d6327 Mon Sep 17 00:00:00 2001 From: kalineid Date: Wed, 5 Jun 2024 17:06:04 +0800 Subject: [PATCH] Fix BitNet weights loading --- ggml-tmac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggml-tmac.cpp b/ggml-tmac.cpp index a66f871f5cdf3..c921f9ad31b3b 100644 --- a/ggml-tmac.cpp +++ b/ggml-tmac.cpp @@ -190,9 +190,9 @@ void ggml_tmac_transform_tensor(struct ggml_tensor * tensor) { qweights = (uint8_t *) aligned_malloc(k * m / 8); } else { qweights = (uint8_t *)tensor->data; - float * scale = (float * )((qweights) + (k * m) / 8); + float * i2_scales = (float * )(qweights + k * m / 8); for (int i = 0; i < scales_size; i++) { - scales[i] = *scale; + scales[i] = (tmac_float_type) i2_scales[i]; } }