Skip to content

Commit

Permalink
when from_pretrained is called in retraining case of lora with flag "…
Browse files Browse the repository at this point in the history
…is_trainable" True, should not call model.eval()
  • Loading branch information
sywangyi committed Jun 16, 2023
1 parent 38e9c65 commit b4b3177
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/peft/peft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ def load_adapter(self, model_id, adapter_name, is_trainable=False, **kwargs):
add_hook_to_module(self.get_base_model(), hook)

# Set model in evaluation mode to deactivate Dropout modules by default
self.eval()
if not is_trainable:
self.eval()
return load_result

def set_adapter(self, adapter_name):
Expand Down

0 comments on commit b4b3177

Please sign in to comment.