(self, batch, outputs: Optional[Any] = None)
| 143 | |
| 144 | class 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": |