Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
fix: outdated models could not be retrained
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Cote-Boucher committed Jan 6, 2021
1 parent d06073b commit 8af1c75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions rasa/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ def should_retrain(
# target_path = os.path.join(train_path, "nlu")
# fingerprint_comparison.nlu = not move_model(old_nlu, target_path)
languages_to_train = fingerprint_comparison.should_retrain_nlu()
if languages_to_train == True: # replace True with list of all langs
languages_to_train = list(new_fingerprint.get("nlu-config", {}).keys())
for lang in old_nlu.keys():
target_path = os.path.join(train_path, "nlu-{}".format(lang))
if lang in new_fingerprint.get("nlu-config").keys():
Expand Down
2 changes: 0 additions & 2 deletions rasa/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ async def _train_async_internal(
fingerprint_comparison = FingerprintComparisonResult(force_training=True)

# bf mod >
if fingerprint_comparison.nlu == True: # replace True with list of all langs
fingerprint_comparison.nlu = list(new_fingerprint.get("nlu-config", {}).keys())
domain = await file_importer.get_domain()
core_untrainable = domain.is_empty() or stories.is_empty()
nlu_untrainable = [l for l, d in nlu_data.items() if d.is_empty()]
Expand Down

0 comments on commit 8af1c75

Please sign in to comment.