Help resolving error ("TextInputSequence must be str")

Hi,
I’m very new to HuggingFace, I’ve come around this error “TextInputSequence must be str” on a notebook which is helping me a lot to do some practice on various hugging face models. The boilerplate code on the notebook is throwing this error (I guess) due to some changes in huggingface’s API or something. So I was wondering if someone could help me and suggest some changes that I can make to the code to resolve the error.

The error can easily be reproduced by just running all the cells of the notebook.
Link: Colab Notebook

To be exact, this is the line that’s throwing the error-

while preprocessing the data convert into string explicitly

Thanks, Anurag!
However, as I’m quite a noob with HuggingFace, could you maybe suggest some changes (addition/deletion) that I can make which may resolve the error?