Hello all, I have been using this code:-
to learn training a summarization model. However, since I needed an extractive model, I replaced ‘sshleifer/distilbart-xsum-12-3’ with “facebook/bart-large-cnn” for both
AutoModelForSeq2SeqLM.from_pretrained & AutoTokenizer.from_pretrained
I am able to train the model and get two different summaries (one before the model is trained and one after the model is trained). But the summaries are abstractive so I changed one option in the training_args (predict_with_generate) to FALSE.
training_args = Seq2SeqTrainingArguments(
output_dir="results",
num_train_epochs=1, # demo
do_train=True,
do_eval=True,
per_device_train_batch_size=4, # demo
per_device_eval_batch_size=4,
# learning_rate=3e-05,
warmup_steps=500,
weight_decay=0.1,
label_smoothing_factor=0.1,
**predict_with_generate=False,**
logging_dir="logs",
logging_steps=50,
save_total_limit=3,
)
However, after doing this, I get an error while running trainer.evaluate() :-1:
text = self._tokenizer.decode(token_ids, skip_special_tokens=skip_special_tokens)
TypeError: 'list' object cannot be interpreted as an integer
And if I comment the option, the code runs albeit without the metrics (rouge etc) and Iam able to get extractive summaries.
Can anyone help in clearing this error so that I can run extractive summaries and get the metrics as well?
Thanks!