If I want to have a stand-alone / compiled version of OpenNMT that does not require any manual preparations / installations on the target machine, and no Internet connection, what are my options to achieve this?
Note: My current implementation depends on a Localhost REST API which is perfect for most cases, but not for the case I mentioned above as the client wants be able to move the whole thing as one package without any prior (manual) preparation or installation of dependencies.
Is Docker pre-installed or is it at least a dependency that is acceptable to install? If yes, that’s a good way to package complex applications like OpenNMT.
Thanks, Guillaume, for the tip about Docker. I will make sure I use it for other cases. As for the case related to this post, I do not think Docker will be installed.
Tested on Windows 7 and 10. Support for 64bit version of Windows only (PyTorch works on Python 64bit only).
How it works:
After launching the installer, it will copy the files to the “Program Files” folder. When the installer finishes, there will be a shortcut on the Desktop called “translate-gui”.
Running the shortcut “translate-gui” (which refers to translate-gui.exe), this window opens.
Select the source file (*.txt)
Select the model file (*.pt)
Click “Translate”.
If everything works fine, it should create the translation file “youtranslation.txt” on the Desktop.
Uninstallation:
To uninstall, simply delete the folder “translate-gui” from the “Program Files” folder.
Changes in the OpenNMT-py code:
Simple use of the same arguments; no serious changes.
1- translate.py - assigning values from the GUI to these variables:
opt.src (source file path - string) opt.models (model file path - list of strings) opt.output (target file path - string)
2- onmt/opts.py
For the arguments -src and -model, changing the attribute “required=True” to “required=False”
So that is it. This is for the local version. My next test should be for the server version.