CASIA-IVA-Lab / AnomalyGPT

[AAAI 2024 Oral] AnomalyGPT: Detecting Industrial Anomalies Using Large Vision-Language Models
https://anomalygpt.github.io
Other
773 stars 94 forks source link

'LoraConfig' is not defined #81

Open EddieEduardo opened 6 months ago

EddieEduardo commented 6 months ago

Hi, great work! Thanks for sharing!

When I trained the released codes after feeding the weights and data as provided in readme, I encountered an error as follows:

1710749903540

I did not make any changes on codes, could you please tell me how to fix thix issue?

Thanks a lot!

EddieEduardo commented 6 months ago

peft_config = LoraConfig( task_type=TaskType.CAUSAL_LM, inference_mode=False, r=self.args['lora_r'], lora_alpha=self.args['lora_alpha'], lora_dropout=self.args['lora_dropout'], target_modules=['q_proj', 'k_proj', 'v_proj', 'o_proj'] )

TaskType is also not defined.

EddieEduardo commented 6 months ago

Add the following 2 lines at the very beginning of the current file: from transformers import LlamaTokenizer from peft import *

EddieEduardo commented 6 months ago

It is quite time-consuming loading models (almost 6 minutes), any optimizing solutions?