From ac8ff26be2ae114a8163ee20c9a41434b7cd95dd Mon Sep 17 00:00:00 2001 From: Mike Lee Date: Wed, 9 Oct 2024 14:19:12 +0800 Subject: [PATCH] [bug] fix torch warnings --- moe_peft/model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moe_peft/model.py b/moe_peft/model.py index fd79429..5ff69a7 100644 --- a/moe_peft/model.py +++ b/moe_peft/model.py @@ -672,7 +672,9 @@ def load_adapter(self, name_or_path: str, adapter_name: Optional[str] = None): lora_config = lora_config_factory(json.load(fp)) lora_config.adapter_name = adapter_name lora_weight = torch.load( - name_or_path + os.sep + "adapter_model.bin", map_location=self.device_ + name_or_path + os.sep + "adapter_model.bin", + map_location=self.device_, + weights_only=False, ) self.init_adapter(lora_config, lora_weight)