From 287d6debf0649e3697f31fb1588e39d8c0ca50a8 Mon Sep 17 00:00:00 2001 From: psp_dada <1824427006@qq.com> Date: Wed, 4 Dec 2024 16:28:52 +0800 Subject: [PATCH] fix 'TinyLlavaForConditionalGeneration' object has no attribute 'peft_config' #142 --- tinyllava/training_recipe/lora_recipe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyllava/training_recipe/lora_recipe.py b/tinyllava/training_recipe/lora_recipe.py index 96509f1..37f8121 100644 --- a/tinyllava/training_recipe/lora_recipe.py +++ b/tinyllava/training_recipe/lora_recipe.py @@ -43,7 +43,7 @@ def training_model_converse(self, model): model.to(torch.bfloat16) if self.training_arguments.fp16: model.to(torch.float16) - if model.peft_config is None: + if not hasattr(model, 'peft_config') or model.peft_config is None: log("Adding LoRA adapters...") model = get_peft_model(model, lora_config) return model