Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix training cache bug in rasa init #9990

Merged
merged 14 commits into from
Oct 29, 2021

Conversation

tayfun
Copy link
Contributor

@tayfun tayfun commented Oct 27, 2021

Fixes #9922

When using rasa init with a new project directory to be created,
current directory was used for caching training data. This meant .rasa
was created in the directory rasa init is run; this resulted in cache
directory not in project directory and also that if model training was
done, this cache directory was not utilized later on.

This PR fixes this by changing into the project directory and then
continuing scaffolding and training afterwards.

Proposed changes:

  • chdir into project directory before training

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

Tayfun Sen added 2 commits October 27, 2021 12:57
Fixes #9922

When using `rasa init` with a new project directory to be created,
current directory was used for caching training data. This meant `.rasa`
was created in the directory `rasa init` is run; this resulted in cache
directory not in project directory and also that if model training was
done, this cache directory was not utilized later on.

This PR fixes this by changing into the project directory and then
continuing scaffolding and training afterwards.
@tayfun tayfun requested a review from a team as a code owner October 27, 2021 12:10
@tayfun tayfun requested review from aeshky, wochinge and a team and removed request for a team October 27, 2021 12:10
Copy link
Contributor

@wochinge wochinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lighning fast! 🏎️ Can we add a test that ensures that if we do rasa init with train that the .rasa folder is in the project dir?

@@ -0,0 +1,3 @@
Fix the directory where caching files are created. This was wrongly the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: Up to you but in my opinion we don't even need a changelog as this wasn't even released yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we don't need this changelog - might be confusing.

@tayfun tayfun requested a review from wochinge October 27, 2021 13:32
Tests cache directories for training data are in project root, not
where `rasa init` is run.
"""
run_with_stdin("init", stdin=b"test-project\n\n\nno\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mhm, I saw your comment on Slack re the timing issues. How about we go through print_train_or_instructions instead of the CLI so we can monkeypatch things to use a quicker model config?

@tayfun tayfun requested a review from joejuzl October 28, 2021 19:22
Copy link
Contributor

@aeshky aeshky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀
Not sure if you want to also wait for an engineer to review it. Worth asking Joe since he's tagged (I think Tobi is away today).

Copy link
Contributor

@joejuzl joejuzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,3 @@
Fix the directory where caching files are created. This was wrongly the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we don't need this changelog - might be confusing.

@tayfun tayfun merged commit 691d857 into main Oct 29, 2021
@tayfun tayfun deleted the tayfun/9922-fix-rasa-init-cache-directory-with-chdir branch October 29, 2021 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rasa init config retrains when comments are removed
4 participants