cisco / mindmeld

An Open Source Conversational AI Platform for Deep-Domain Voice Interfaces and Chatbots.
http://mindmeld.com
Apache License 2.0
677 stars 186 forks source link

Loading fails after two consecutive incremental builds #424

Closed vrdn-23 closed 2 years ago

vrdn-23 commented 2 years ago

The incremental build of models in Mindmeld currently exhibits a weird behavior where consecutive incremental builds cannot be loaded unless the dump functionality is explicitly called. This behavior can be reproduced by the following code snippet:

nlp = NaturalLanguageProcessor(kwik_e_mart_app_path)
nlp.build(incremental=True)
initial_timestamp = nlp.incremental_timestamp

nlp = NaturalLanguageProcessor(kwik_e_mart_app_path)
nlp.build(incremental=True)
new_timestamp = nlp.incremental_timestamp

nlp.load(initial_timestamp)
nlp.load(new_timestamp)

The current behavior leads to a FileNotFoundError as we try to load the non-incremental models from the non-timestamp path.

FileNotFoundError: [Errno 2] No such file or directory: 'kwik_e_mart/.generated/cached_models/20220628T172423/domains/banking/transfer_money/entity.pkl 

One way to bypass this error, is to explicitly call dump after each build statement, but this does nit align with the expected behavior.