Having troubel in understanding what loss is currently in use

I was going through this hugging face code and I am having trouble understanding what loss the model is currently using. Although I know most seq2seq models uses CrossEntrophy loss but I don’t see the definition anywhere in the code

Actually I want to train the model with a new custom loss. I have trained a baseline model and its working fine.

Thank You

Most of the pre trained model classes have a default loss function that gets called inside the train method. I usually lookup the model source code to find out the loss method if I need to.

If you are using the trainer class you can override the loss method by following the first example on this link.