From c7104f8fabf87a879714ddfd14e501a4b434ded3 Mon Sep 17 00:00:00 2001 From: hiyouga Date: Tue, 2 Apr 2024 13:58:39 +0800 Subject: [PATCH] fix #3022 Former-commit-id: 9ddbe2866a4a4433d7635659a5635d16c59800b1 --- src/llmtuner/model/patcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llmtuner/model/patcher.py b/src/llmtuner/model/patcher.py index db9849cf..379b0c48 100644 --- a/src/llmtuner/model/patcher.py +++ b/src/llmtuner/model/patcher.py @@ -336,7 +336,7 @@ def patch_model( if is_trainable and getattr(model.config, "model_type", None) == "qwen2" and model_args.flash_attn: setattr(model.config, "use_cache", False) # qwen2 does not support use_cache when using flashattn - if is_trainable and model_args.resize_vocab: + if model_args.resize_vocab: _resize_embedding_layer(model, tokenizer) if is_trainable: