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
This file has been truncated.
# 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
# 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:
Actually I want to train the model with a new custom loss. I have trained a baseline model and its working fine.
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.