Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions optimum/habana/sentence_transformers/st_gaudi_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ def compute_loss(
and model != self.model # Only if the model is wrapped
and hasattr(loss_fn, "model") # Only if the loss stores the model
and loss_fn.model != model # Only if the wrapped model is not already stored
and hasattr(model, "module")
and loss_fn.model != model.module # wrapped model differs from orig model
):
loss_fn = self.override_model_in_loss(loss_fn, model)
loss = loss_fn(features, labels)
Expand Down