Skip to content

Commit

Permalink
Merge pull request #4898 from RasaHQ/fix_file_order
Browse files Browse the repository at this point in the history
Make order of files loaded consistent
  • Loading branch information
akelad committed Dec 4, 2019
2 parents 93b0948 + 33ebe75 commit acedba4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/4898.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Training data files now get loaded in the same order (especially relevant to subdirectories) each time to ensure training consistency when using a random seed.
3 changes: 2 additions & 1 deletion rasa/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def _find_core_nlu_files_in_directory(directory: Text,) -> Tuple[Set[Text], Set[
nlu_data_files = set()

for root, _, files in os.walk(directory):
for f in files:
# we sort the files here to ensure consistent order for repeatable training results
for f in sorted(files):
full_path = os.path.join(root, f)

if not _is_valid_filetype(full_path):
Expand Down

0 comments on commit acedba4

Please sign in to comment.