MCPcopy Create free account
hub / github.com/huggingface/transformers / training_step

Method training_step

examples/seq2seq/finetune.py:130–133  ·  view source on GitHub ↗
(self, batch, batch_idx)

Source from the content-addressed store, hash-verified

128 return (loss,)
129
130 def training_step(self, batch, batch_idx) -> Dict:
131 loss_tensors = self._step(batch)
132 logs = {name: loss for name, loss in zip(self.loss_names, loss_tensors)}
133 return {"loss": loss_tensors[0], "log": logs}
134
135 def validation_step(self, batch, batch_idx) -> Dict:
136 return self._generative_step(batch)

Callers

nothing calls this directly

Calls 1

_stepMethod · 0.95

Tested by

no test coverage detected