This commit is contained in:
Sourab Mangrulkar
2023-04-06 19:31:21 +05:30
parent dee2a96fea
commit b6c751455e
+1 -1
View File
@@ -331,7 +331,7 @@ class PeftModel(PushToHubMixin, torch.nn.Module):
if isinstance(peft_config, PromptLearningConfig) and is_trainable:
raise ValueError("Cannot set a prompt learning adapter to trainable when loading pretrained adapter.")
else:
peft_config[adapter_name].inference_mode = not is_trainable
peft_config.inference_mode = not is_trainable
self.add_adapter(adapter_name, peft_config)
# load weights if any