I’m new to using OpenNMT, but have used PyTorch and TF. I trained a text-to-text Transformer model using OpenNMT-py, but always had to provide a file for input and a destination file to get the outputs. I checked https://github.com/OpenNMT/OpenNMT-py/blob/f7fc40e319c03b90addc7e3364635e0fc7625b95/docs/source/Library.ipynb, where still the input is fed through *.pt. Is there a way I can write something like the following in OpenNMT ? Thanks in advance!
model = my_model
sent = input("Enter your input: ") #input sentence in English
translated_sent = my_model.translate(sent) #translated sentence