Transformer application for spectra regression

I have recently been learning transformer, but I found that most of the transformers are used for image recognition and classification, which are two-dimensional. Is there any transformer for one-dimensional spectral data regression tasks? I have tried to use transformer for regression on one-dimensional data, but I encountered a problem about how to set the length of the input sequence.