What is the Path object that you create? You can give torch.load() the string containing the path. Otherwise, as said in the error message, you should read the file in a buffer and give that buffer to torch.load().