Add support for fine-tuning Hidream O1 (#831)
* Initial support for hidream. Lora keys likely need work * Fix saving for hidream-o1 * Remove dependence on flash attention for hidream o1 * Fix gradient checkpointing for hidream o1 * A lot of fixes for hidream. Handle loading and saving as comfy model. * Omit layers not used in comfy. Fix issue with lora loading keys in comfy * Version bumpo
This commit is contained in:
committed by
GitHub
parent
f38de2a2fe
commit
fc4d6ebf39
@@ -916,7 +916,17 @@ class SDTrainer(BaseSDTrainProcess):
|
||||
loss = loss + norm_std_loss
|
||||
|
||||
|
||||
return loss + additional_loss
|
||||
loss = loss + additional_loss
|
||||
|
||||
if self.train_config.max_loss_debug and self.train_config.max_loss is not None:
|
||||
if loss.item() > self.train_config.max_loss:
|
||||
print_acc(f"Loss {loss.item()} is greater than max loss {self.train_config.max_loss}. Clipping to max loss.")
|
||||
print_acc(f"timesteps: {timesteps}")
|
||||
|
||||
if self.train_config.max_loss is not None:
|
||||
loss = torch.clamp(loss, max=self.train_config.max_loss)
|
||||
|
||||
return loss
|
||||
|
||||
def preprocess_batch(self, batch: 'DataLoaderBatchDTO'):
|
||||
return batch
|
||||
|
||||
Reference in New Issue
Block a user