The following columns in the training set don't have a corresponding argument
Hello,I am trying to fine tune a T5 model using xsum dataset but I am getting the following. Should I just change the sames “summary, document and id” to something else? Or that’s due to something else?The following columns in the training set don’t have a corresponding argument inT5ForConditionalGeneration.forwardand have been ignored: summary, document, id.Many thanks!
2022-09-26T11:12:15Z
Hi,The Trainer automatically ignores columns in your dataset which aren’t used by the model. For T5 for instance, the model expectsinput_ids,attention_mask,labelsetc., but not “summary”, “document”, “id”. As long asinput_idsetc are in your dataset, it’s fine.The warning is just telling you that those columns aren’t used.
2024-10-05T20:05:13Z
image1920×1080 196 KBNo it not working for please help!import pandas as pdLoad the original datasetdata = load_dataset(“jcordon5/cybersecurity-rules”)Convert the training dataset to a pandas DataFramedf = pd.DataFrame(data[“train”])Create a new Dataset from the DataFrame, ensuring only the required columnsdf = df[[‘instruction’, ‘output’]] # Keep only ‘instruction’ and ‘output’Convert the DataFrame back into a Datasettrain_dataset = Dataset.from_pandas(df)Create a DatasetDictdata = DatasetDict({‘train’: train_dataset})Verify the structure of the new dataset dictionarydatadata = data.map(lambda samples: tokenizer(samples[“instruction”], padding=“max_length”,truncation=True),batched=True)dataFormatting function (ensure full output is included)def formatting_func(example):text = f"Output: {example[‘output’]}"  # Return entire outputreturn [text]