Skip to content

Commit 65923a8

Browse files
committed
convert : determine n_ctx correctly
1 parent 8614aa7 commit 65923a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

convert.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ def loadOriginalParamsJson(model: LazyModel, config_path: Path) -> Params:
261261
n_experts_used = None
262262

263263
# hack to determine LLaMA v1 vs v2 vs CodeLlama
264-
if config.get("rope_theta") == 1000000:
264+
if config.get("moe"):
265+
# Mixtral
266+
n_ctx = 32768
267+
elif config.get("rope_theta") == 1000000:
265268
# CodeLlama
266269
n_ctx = 16384
267270
elif config["norm_eps"] == 1e-05:
268271
# LLaMA v2
269272
n_ctx = 4096
270-
elif config["moe"]:
271-
# Mixtral
272-
n_ctx = 32768
273273
else:
274274
# LLaMA v1
275275
n_ctx = 2048

0 commit comments

Comments
 (0)