fix attribute error
This commit is contained in:
@@ -87,24 +87,24 @@ class LoraConfig(BaseModel):
|
||||
def validate_qlora(self):
|
||||
if self.adapter == "qlora":
|
||||
if self.merge_lora:
|
||||
if self.quantization.bits == 8 or self.cfg.load_in_8bit:
|
||||
if self.quantization.bits == 8 or self.load_in_8bit:
|
||||
raise ValueError("Can't merge qlora if loaded in 8bit")
|
||||
|
||||
if self.quantization.backend == "gptq":
|
||||
raise ValueError("Can't merge qlora if using gptq")
|
||||
|
||||
if self.quantization.bits == 4 or self.cfg.load_in_4bit:
|
||||
if self.quantization.bits == 4 or self.load_in_4bit:
|
||||
raise ValueError("Can't merge qlora if loaded in 4bit")
|
||||
|
||||
else:
|
||||
if self.quantization:
|
||||
if self.quantization.bits == 8 or self.cfg.load_in_8bit:
|
||||
if self.quantization.bits == 8 or self.load_in_8bit:
|
||||
raise ValueError("Can't load qlora in 8bit")
|
||||
|
||||
if self.quantization.backend == "gptq":
|
||||
raise ValueError("Can't load qlora if using gptq")
|
||||
|
||||
if not self.quantization.bits == 4 or self.cfg.load_in_4bit:
|
||||
if not self.quantization.bits == 4 or self.load_in_4bit:
|
||||
raise ValueError("Require quantization.bits <= 4 for qlora")
|
||||
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user