Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 37d01f3

Browse files
authored
fix convert_quantized model bug (#158)
Signed-off-by: Yu, Zhentao <zhentao.yu@intel.com>
1 parent a129213 commit 37d01f3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

neural_speed/convert/convert_quantized_llama.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def convert_to_q4_bestla_tensor(src_name, dst_name, model, fout, q_config, n_hea
7171
int_weight = (int_weight - 8) * 16
7272
gptq_scales = gptq_scales / 16
7373
gptq_zeros = (gptq_zeros - 8) * 16
74-
weight_dtype == "int4"
74+
weight_dtype = "int4"
7575

7676
dst = np.zeros((int_weight.shape[0], int_weight.shape[1] * 4), dtype=np.int8)
7777
int_weight = np.ascontiguousarray(int_weight.numpy())

neural_speed/convert/convert_quantized_mistral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def convert_to_q4_bestla_tensor(src_name, dst_name, model, fout, q_config, n_hea
7474
int_weight = (int_weight - 8) * 16
7575
gptq_scales = gptq_scales / 16
7676
gptq_zeros = (gptq_zeros - 8) * 16
77-
weight_dtype == "int4"
77+
weight_dtype = "int4"
7878

7979
dst = np.zeros((int_weight.shape[0], int_weight.shape[1] * 4), dtype=np.int8)
8080
int_weight = np.ascontiguousarray(int_weight.numpy())

neural_speed/convert/convert_quantized_mixtral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def convert_to_q4_bestla_tensor(src_name, dst_name, model, fout, q_config, n_hea
8080
int_weight = (int_weight - 8) * 16
8181
gptq_scales = gptq_scales / 16
8282
gptq_zeros = (gptq_zeros - 8) * 16
83-
weight_dtype == "int4"
83+
weight_dtype = "int4"
8484

8585
dst = np.zeros((int_weight.shape[0], int_weight.shape[1] * 4), dtype=np.int8)
8686
int_weight = np.ascontiguousarray(int_weight.numpy())

0 commit comments

Comments
 (0)