502 B
502 B
Memory management
From Python
To release the resources used by Translator and Generator instances, you can simply delete the object, e.g.:
del translator
In some cases, you might want to temporarily unload the model and load it back later. The Translator object provides the methods unload_model and load_model for this purpose. The model can be either fully unloaded or moved to the CPU memory.