Having troubel in understanding what loss is currently in use
I was going through this hugging face code and I am having trouble understandingwhat loss the model is currently using. Although I know most seq2seq models uses CrossEntrophy loss butI don’t see the definition anywhere in the codegithub.comhuggingface/transformers/blob/aca6288ff42cebded5421020f0ff088adeb446dd/examples/language-modeling/run_clm.py#!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Fine-tuning the library models for causal language modeling (GPT, GPT-2, CTRL, ...) on a text file or a dataset.

Here is the full list of checkpoints on the hub that can be fine-tuned by this script:
https://huggingface.co/models?filter=causal-lmThis file has been truncated.show originalActually I want to train the model with a new custom loss. I have trained a baseline model and its working fine.Thank You
2023-11-24T12:21:22Z
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.huggingface.coTrainerWe’re on a journey to advance and democratize artificial intelligence through open source and open science.