The error message points towards a shape mismatch:
RuntimeError: mat1 dim 1 must match mat2 dim 0

so you could add print statements to the model’s forward and check, which operation fails and what the shapes of the used tensors are.