From 9addf2485fdd1323c966e545f3c79347d2426915 Mon Sep 17 00:00:00 2001 From: Melinda Loubser <32034278+melindaloubser1@users.noreply.github.com> Date: Thu, 22 Oct 2020 15:39:06 +0200 Subject: [PATCH] append stories if file exists (#7044) --- rasa/shared/core/trackers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rasa/shared/core/trackers.py b/rasa/shared/core/trackers.py index ba6518f8582d..2e44fc1c2441 100644 --- a/rasa/shared/core/trackers.py +++ b/rasa/shared/core/trackers.py @@ -625,10 +625,12 @@ def export_stories_to_file(self, export_path: Text = "debug_stories.yml") -> Non YAMLStoryWriter, ) - append = not os.path.exists(export_path) + append = os.path.exists(export_path) rasa.shared.utils.io.write_text_file( - self.export_stories(YAMLStoryWriter()) + "\n", export_path, append=append + self.export_stories(YAMLStoryWriter(), should_append_stories=append) + "\n", + export_path, + append=append, ) def get_last_event_for(