Skip to content

Commit

Permalink
fix inference test
Browse files Browse the repository at this point in the history
  • Loading branch information
goliaro committed Nov 4, 2024
1 parent d09ba0c commit fc884fe
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/peft/hf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ def save_lora_weights(self, model, pre_finetuning=False):
if not pre_finetuning:
self.step_count += 1

def on_step_end(
self, args, state, control, model, tokenizer, optimizer, lr_scheduler, **kwargs
):
self.save_lora_weights(model, pre_finetuning=False)

def on_step_begin(
self, args, state, control, model, tokenizer, optimizer, lr_scheduler, **kwargs
):
self.save_lora_weights(model, pre_finetuning=True)
def on_step_end(self, args, state, control, **kwargs):
model_ = kwargs.get("model", None)
assert model_ is not None
self.save_lora_weights(model_, pre_finetuning=False)

def on_step_begin(self, args, state, control, **kwargs):
model_ = kwargs.get("model", None)
assert model_ is not None
self.save_lora_weights(model_, pre_finetuning=True)

def on_train_end(self, args, state, control, **kwargs):
if verbose:
Expand Down

0 comments on commit fc884fe

Please sign in to comment.