update reference
This commit is contained in:
parent
5ff11b5bf2
commit
6aab31bd73
|
|
@ -248,7 +248,7 @@ def load_llama_model_4bit_low_ram_and_offload(config_path, model_path, lora_path
|
||||||
|
|
||||||
if lora_path is not None:
|
if lora_path is not None:
|
||||||
from peft import PeftModel
|
from peft import PeftModel
|
||||||
from peft.tuners.lora import Linear4bitLt
|
from monkeypatch.peft_tuners_lora_monkey_patch import Linear4bitLt
|
||||||
model = PeftModel.from_pretrained(model, lora_path, device_map={'': 'cpu'}, torch_dtype=torch.float32)
|
model = PeftModel.from_pretrained(model, lora_path, device_map={'': 'cpu'}, torch_dtype=torch.float32)
|
||||||
print(Style.BRIGHT + Fore.GREEN + '{} Lora Applied.'.format(lora_path))
|
print(Style.BRIGHT + Fore.GREEN + '{} Lora Applied.'.format(lora_path))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ import torch
|
||||||
import autograd_4bit
|
import autograd_4bit
|
||||||
from autograd_4bit import load_llama_model_4bit_low_ram, Autograd4bitQuantLinear
|
from autograd_4bit import load_llama_model_4bit_low_ram, Autograd4bitQuantLinear
|
||||||
from peft import PeftModel
|
from peft import PeftModel
|
||||||
from peft.tuners.lora import Linear4bitLt
|
from monkeypatch.peft_tuners_lora_monkey_patch import replace_peft_model_with_gptq_lora_model, Linear4bitLt
|
||||||
|
replace_peft_model_with_gptq_lora_model()
|
||||||
|
|
||||||
patch_encode_func = False
|
patch_encode_func = False
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue