diff --git a/modeling/inference_models/hf_torch.py b/modeling/inference_models/hf_torch.py index d4d5320b..c46195ba 100644 --- a/modeling/inference_models/hf_torch.py +++ b/modeling/inference_models/hf_torch.py @@ -215,7 +215,15 @@ class HFTorchInferenceModel(HFInferenceModel): # PEFT Loading. This MUST be done after all save_pretrained calls are # finished on the main model. if utils.args.peft: - peft_local_path = os.path.join("models/peft", utils.args.peft.replace("/", "_")) + local_peft_dir = os.path.join(m_self.get_local_model_path(), "peft") + + # Make PEFT dir if it doesn't exist + try: + os.makedirs(local_peft_dir) + except FileExistsError: + pass + + peft_local_path = os.path.join(local_peft_dir, utils.args.peft.replace("/", "_")) logger.debug(f"Loading PEFT '{utils.args.peft}', possible local path is '{peft_local_path}'.") peft_installed_locally = True diff --git a/models/peft/README.txt b/models/peft/README.txt deleted file mode 100644 index fc7b72c4..00000000 --- a/models/peft/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -PEFT models will be stored in this directory when downloaded. -Please don't be too mean to this directory.