This method will be called after data_collator and before the forward Args: data: The `_data` field from the example batch, this field should be packed manually Returns: Any extra fields need to be passed into the model.forward
(self, model: Module, data: Any)
| 237 | setattr(self, key, value) |
| 238 | |
| 239 | def post_encode(self, model: Module, data: Any) -> Dict[str, Any]: |
| 240 | """This method will be called after data_collator and before the forward |
| 241 | Args: |
| 242 | data: The `_data` field from the example batch, this field should be packed manually |
| 243 | Returns: |
| 244 | Any extra fields need to be passed into the model.forward |
| 245 | """ |
| 246 | return {} |
| 247 | |
| 248 | def check_example(self, example: Dict[str, Any]) -> None: |
| 249 | """Check example valid""" |