Skip to content

Commit 3839704

Browse files
committed
convert-new.py : minor fixes
1 parent 5d04440 commit 3839704

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

convert-new.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def loadOriginalParamsJson(model: 'LazyModel', config_path: 'Path') -> 'Params':
193193
n_ctx = 2048 if config["norm_eps"] == 1e-06 else 4096 # hack to determine LLaMA v1 vs v2
194194
n_ff = -1;
195195
n_head = config["n_heads"];
196-
n_head_kv = config["n_kv_head"] if "n_kv_head" in config else n_head;
196+
n_head_kv = config["n_kv_heads"] if "n_kv_heads" in config else n_head;
197197
f_norm_eps = config["norm_eps"];
198198

199199
if n_vocab == -1:
@@ -796,9 +796,9 @@ def do_item(item: Tuple[str, LazyTensor]) -> NDArray:
796796
def pick_output_type(model: LazyModel, output_type_str: Optional[str]) -> GGMLFileType:
797797
wq_type = model[NAMES[gguf.MODEL_TENSOR.ATTN_Q].format(bid=0)+".weight"].data_type
798798

799-
if output_type_str == "f32" or (output_type_str is None and wq_type in (DT_F32, DT_BF16)):
799+
if output_type_str == "f32" or (output_type_str is None and wq_type == DT_F32):
800800
return GGMLFileType.AllF32
801-
if output_type_str == "f16" or (output_type_str is None and wq_type == DT_F16):
801+
if output_type_str == "f16" or (output_type_str is None and wq_type in (DT_F16, DT_BF16)):
802802
return GGMLFileType.MostlyF16
803803

804804
name_to_type = {name: lazy_tensor.data_type for (name, lazy_tensor) in model.items()}

0 commit comments

Comments
 (0)