support auto detact lora target modules

This commit is contained in:
Artiprocher
2026-01-21 11:05:05 +08:00
parent 3743b1307c
commit d13f533f42
3 changed files with 40 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ class ModelLogger:
self.num_steps = 0
def on_step_end(self, accelerator: Accelerator, model: torch.nn.Module, save_steps=None):
def on_step_end(self, accelerator: Accelerator, model: torch.nn.Module, save_steps=None, **kwargs):
self.num_steps += 1
if save_steps is not None and self.num_steps % save_steps == 0:
self.save_model(accelerator, model, f"step-{self.num_steps}.safetensors")