-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 Interactive story counter #8086
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Rafael Teodosio <rafzteodosio@gmail.com>
Co-authored-by: joao vitor silva <joaovitordmrosa@hotmail.com>
Co-authored-by: Rafael Teodosio <rafzteodosio@gmail.com>
…ES/rasa into interactive-story-counter
Co-authored-by: Rafael Teodosio <rafzteodosio@gmail.com>
Co-authored-by: Rafael Teodosio <rafzteodosio@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the fix on the interactive learning dumping. Do you mind taking a look at adding a test and a changelog entry? Let me know if you need pointers 🙂
rasa/core/training/interactive.py
Outdated
with open( | ||
export_story_path, "r", encoding=rasa.shared.utils.io.DEFAULT_ENCODING | ||
) as f: | ||
i = sum(1 for s in f if 'interactive_story_' in s) + 1 # count the times string 'interactive story' occur in file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make interactive_story_
a constant to ensure it stays the same between this line and L831
rasa/core/training/interactive.py
Outdated
with open( | ||
export_story_path, "r", encoding=rasa.shared.utils.io.DEFAULT_ENCODING | ||
) as f: | ||
i = sum(1 for s in f if 'interactive_story_' in s) + 1 # count the times string 'interactive story' occur in file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we are here, let's give that i
a more expressive name
rasa/core/training/interactive.py
Outdated
@@ -816,10 +816,15 @@ def _write_stories_to_file( | |||
else: | |||
append_write = "w" # make a new file if not | |||
|
|||
with open( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind adding a test to check this will work in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelteodosio and i don't know how make the requested test. @tmbo could you give us some advices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look here tests/core/training/test_interactive.py
. You can write a test that exports twice and assert that the correct count is used for both.
Ok @tmbo , @joaoCeilandia and I will make the requested changes, thanks for your time. |
…able Co-authored-by: Rafael Teodosio <rafzteodosio@gmail.com>
Co-authored-by: joao vitor silva <joaovitordmrosa@hotmail.com>
Co-authored-by: Rafael Teodosio <rafzteodosio@gmail.com>
@tmbo We made the requested changes. |
I don't know if we could do this, but can i request your review here @melindaloubser1? We need this for a subject of our college. |
I think since @tmbo has been following this PR, it's best if he does a final review of it. It needs a test to be written as well. |
Ok, thanks for your time and support @melindaloubser1 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rafaelteodosio - any progress with this?
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Proposed changes:
Status:
black
(please check Readme for instructions)