Based on the code you provided, it's difficult to see exactly what the problem is. The error mentions that a NumPy array is converted to a Torch Tensor, but, In the code you provided, there is no obvious place where a NumPy array is converted to a Tensor. I may be able to do a better job helping you if you provide some additional surrounding code, and perhaps the exact error message you get.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence