MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / eval_forward

Method eval_forward

src/flex_bert.py:145–148  ·  view source on GitHub ↗
(self, batch, outputs: Optional[Any] = None)

Source from the content-addressed store, hash-verified

143
144class EfficientHuggingFaceModel(HuggingFaceModel):
145 def eval_forward(self, batch, outputs: Optional[Any] = None):
146 outputs = self.forward(batch) if outputs is None else outputs
147 self.labels = batch.pop("labels")
148 return outputs
149
150 def update_metric(self, batch: Any, outputs: Any, metric: Metric) -> Dict:
151 if metric.device.type == "cpu":

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected