Try loading the model before wrapping it as a DataParallel object:
device = torch.device(‘cuda’ if torch.cuda.is_available() else ‘cpu’)
model = Model(opt)
file_path=’/content/drive/MyDrive/VitSTR/vitstr_tiny_patch16_224_aug.pth’
model.load_state_dict(torch.load(file_path))
model = torch.nn.DataParallel(model).to(device)

This is because once you wrap the model in DataParallel, you will need to write model.module to access your original object of class  Model() .
Also, remember that it recommended to always use DistributedDataParallel over DataParallel whenever possible.
This a guide 2 that I found really useful to learn about how to use the DistributedDataParallel for multi-gpu/multi-node training.