Sorry, I don’t have the time to help with debugging, and you’re better served anyways by going through the huggingface docs and adapting/understanding the code from a few examples.
In particular, these two links should be helpful:
  

      github.com
  

  
    huggingface/notebooks/blob/master/examples/summarization.ipynb 2


    {
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "X4cRE8IbIrIV"
   },
   "source": [
    "If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets as well as other dependencies. Uncomment the following cell and run it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "id": "MOsHUjgdIrIW",



  This file has been truncated. show original

  

  
    
    
  

  


and also this:
  

      github.com
  

  
    huggingface/transformers/blob/master/examples/pytorch/summarization/run_summarization.py 2


    #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace 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 sequence to sequence.
"""
# You can also adapt this script on your own sequence to sequence task. Pointers for this are left as comments.




  This file has been truncated. show original

  

  
    
    
  

  


Take a look at those and adapt the code to your needs (especially preprocessing part).
Cheers