diff --git a/.gitignore b/.gitignore index 2405a81fc5..a30fd144c8 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ .DS_Store .eslintrc.js .idea +.env .venv venv .vscode diff --git a/modules/GPTQ_loader.py b/modules/GPTQ_loader.py index fe5577e1e5..7dc20b0a0e 100644 --- a/modules/GPTQ_loader.py +++ b/modules/GPTQ_loader.py @@ -62,7 +62,7 @@ def noop(*args, **kwargs): from safetensors.torch import load_file as safe_load model.load_state_dict(safe_load(checkpoint), strict=False) else: - model.load_state_dict(torch.load(checkpoint), strict=False) + model.load_state_dict(torch.load(checkpoint, weights_only=True), strict=False) model.seqlen = 2048 return model diff --git a/modules/training.py b/modules/training.py index b887fa479e..c01f27db1d 100644 --- a/modules/training.py +++ b/modules/training.py @@ -544,7 +544,7 @@ def generate_and_tokenize_prompt(data_point): lora_model = get_peft_model(shared.model, config) if not always_override and Path(f"{lora_file_path}/adapter_model.bin").is_file(): logger.info("Loading existing LoRA data...") - state_dict_peft = torch.load(f"{lora_file_path}/adapter_model.bin") + state_dict_peft = torch.load(f"{lora_file_path}/adapter_model.bin", weights_only=True) set_peft_model_state_dict(lora_model, state_dict_peft) except: yield traceback.format_exc().replace('\n', '\n\n')