Hi,
I haven’t gone through the notebook, just checked the module you sent.
-
No need to define the loss module as it is already defined and used in hf model itself.
Since you don’t use it anywhere I assume it’s just a leftover code. -
For metrics I would suggest using TorchMetrics as it play great with Lighting and it makes computing the metrics easy in distributed training. With your current implementation there might be a problem if the last batch is shorter than the other batches.
-
Yes if you want to do the inference you have to define the predict function.