ValueError: too many dimensions 'str'

I am totally new to this LLM thing, so I wrote this code for my own practice. However, I am hitting these road blocks and there’s not much help elsewhere on the internet that is helpful.

The data sources that they used is clearly from hugging face, and when I use the squad model, I have no errors when running it. However, when I tried using my data file, I get one error after another, even if it meant readjusting my code etc, so I can never get my program to train model using my json file. And there is almost little to no useful information on how to train models using a custom dataset, as most of the information is only applied to online HF datasets. If you see my recent post, I get a new error mentioned in the latest comment:

so yea, quite frustrating for me.

Here are some of the sources for this code and the latest code.

https://www.mlexpert.io/blog/alpaca-fine-tuning
https://huggingface.co/docs/transformers/training