@krrishabh
Since the error message says “error loading the model”, it is likely the program failed to load the model file in torch::jit::load(path).
Please make sure data/pytorch/rnnlm/newmodel2.pt exists and it is accessible from the binary.
If you compile the program into build directory, the path might be ../data/pytorch/rnnlm/newmodel2.pt.
And the message “_ivalue_ INTERNAL ASSERT FAILED at ...” is shown when an instance of torch::jit::script::Module is not initialized (like the situation that the exception from torch::jit::load() is caught and you reference the uninitialized module instance after that).