LLM: Fix chatglm3-6b-32k error (#10719)

* fix chatglm3-6b-32k

* update style
This commit is contained in:
Wang, Jian4 2024-04-10 11:24:06 +08:00 committed by GitHub
parent 585c174e92
commit c9e6d42ad1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)