From: Xuan Son Nguyen Date: Wed, 3 Jul 2024 14:01:54 +0000 (+0200) Subject: fix phi 3 conversion (#8262) X-Git-Tag: upstream/0.0.4488~1199 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=916248af1f3c16abd7408de848e025da095c621c;p=pkg%2Fggml%2Fsources%2Fllama.cpp fix phi 3 conversion (#8262) --- diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 6add27cb..d01aed22 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -1942,7 +1942,7 @@ class Phi3MiniModel(Model): if len(rope_scaling_type) == 0: raise KeyError('Missing the required key rope_scaling.type') - if rope_scaling_type == 'su': + if rope_scaling_type == 'su' or rope_scaling_type == 'longrope': attn_factor = math.sqrt(1 + math.log(scale) / math.log(orig_max_pos_embds)) if scale > 1.0 else 1.0 elif rope_scaling_type == 'yarn': attn_factor = 0.1 * math.log(scale) + 1.0 if scale > 1.0 else 1.0