Skip to content

Commit d6d905b

Browse files
author
Nikolay Borisov
committed
convert: Fix detection of LLAMA2
In recent downloads of LLAMA2 dataset the norm_eps is set to 1e-06, this leads to convert.py erroneously considering the model to be LLAMA1 and setting the context to 2k tokens. Fix it by extending the existing hack to also check for the 1e-06 value.
1 parent 2833a6f commit d6d905b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def loadOriginalParamsJson(model: LazyModel, config_path: Path) -> Params:
250250
if config.get("rope_theta") == 1000000:
251251
# CodeLlama
252252
n_ctx = 16384
253-
elif config["norm_eps"] == 1e-05:
253+
elif config["norm_eps"] in (1e-05, 1e-06):
254254
# LLaMA v2
255255
n_ctx = 4096
256256
else:

0 commit comments

Comments
 (0)