From c9e6d42ad10598193e14d175cb5d1b01bd33232e Mon Sep 17 00:00:00 2001 From: "Wang, Jian4" <61138589+hzjane@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:24:06 +0800 Subject: [PATCH] LLM: Fix chatglm3-6b-32k error (#10719) * fix chatglm3-6b-32k * update style --- python/llm/src/ipex_llm/transformers/convert.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/llm/src/ipex_llm/transformers/convert.py b/python/llm/src/ipex_llm/transformers/convert.py index 6d81c677..ff133b35 100644 --- a/python/llm/src/ipex_llm/transformers/convert.py +++ b/python/llm/src/ipex_llm/transformers/convert.py @@ -889,7 +889,8 @@ def _optimize_post(model, lightweight_bmm=False): if model.config.architectures is not None \ and model.config.architectures[0] in ["ChatGLMModel", "ChatGLMForConditionalGeneration"]: - if model.config.num_layers == 28 and hasattr(model.config, 'rope_ratio'): + if (model.config.num_layers == 28 and hasattr(model.config, 'rope_ratio') + and model.config.rope_ratio == 16): # chatglm2-6b-32k modeling_module_name = model.__class__.__module__ module = importlib.import_module(modeling_module_name)