Preprocessing inputs for mandolin.