snipsco / snips-nlu

Snips Python library to extract meaning from text
https://snips-nlu.readthedocs.io
Apache License 2.0
3.89k stars 514 forks source link

Fix issue when persisting resources #738

Closed adrienball closed 5 years ago

adrienball commented 5 years ago

Description: When persisting a SnipsNLUEngine object, the resources are copied to the destination path from the path where they were initially fetched. This is wrong as, once loaded, a SnipsNLUEngine instance should be self contained in memory, which means that deleting the underlying resources directory should not affect its behavior. This PR fixes this by persisting the resources by serializing the resources objects that are loaded in memory. Each engine now owns its resources.

Checklist: