Anyway, I managed to load the encoder this way by previously downloading the pre-trained model from Github.
Regards,
import torch
model = ESPNet(20,encoderFile="espnet_p_2_q_8.pth", p=2, q=8)
example = torch.rand(1, 3, 224, 224)
traced_script_module = torch.jit.trace(model, example)
traced_script_module.save("model.pt") #Will do the same save a load_dict
#Exemple de save du modele ESPNet avec TorchScript
torch.jit.save(traced_script_module, "scriptmodel.pth")
#Load example with ToarchScript
modelLoaded = torch.jit.load("scriptmodel.pth")