I downloaded the wikitext dataset:
from datasets import load_dataset
dataset = load_dataset("wikitext",'wikitext-103-raw-v1')
After downloading it I used SFTtrainer:
from trl import SFTTrainer
max_seq_length = 512
trainer = SFTTrainer(
model=model,
train_dataset=dataset["train"],
peft_config=peft_config,
dataset_text_field="text",
max_seq_length=max_seq_length,
tokenizer=tokenizer,
args=training_arguments,
)
After using trainer.train()
it gave the error "IndexError: Invalid key: 1593817 is out of bounds for size 0
"