Just make a class wrapper. First, make all preprocessing functions torchscript friendly, then you can create a class like:
class Wrapper(nn.Module):
    def __init__(self, preprocess_fn, model):
       self.preprocess_fn = preprocess_fn
       self.model = model

    def forward(self, x): # remember, by default, x is expected to be a torch.Tensor. 
        return self.model(self.preprocess_fn(x))

wrapper = Wrapper(your_preprocess_function, your_model)
wrapper_ts = torch.jit.script(wrapper)

And that’s all!
I did the same approach but to integrate some post processing steps without needing to deploy extra python files.