Skip to content

Commit

Permalink
append stories if file exists (#7044)
Browse files Browse the repository at this point in the history
  • Loading branch information
indam23 authored Oct 22, 2020
1 parent fc0962c commit 9addf24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rasa/shared/core/trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9addf24

Please sign in to comment.