-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
remove _warn_and_correct_transformer_size funct #10819
remove _warn_and_correct_transformer_size funct #10819
Conversation
d2b52a9
to
402ee76
Compare
7e77db2
to
db5d282
Compare
Co-authored-by: Washington <[email protected]>
db5d282
to
9db1876
Compare
Co-authored-by: Washington <[email protected]>
@jupyterjazz can you check later please? And I don't know why codeclimate failed if I didn't change these files :( |
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.
Good job 🚀 I'm not sure why codeclimate is failing. I'll look at it later, but before that we still need to change few things:
- Add a changelog file. You can see how it's done here.
- Update PR description and link the original issue there
- After all these changes are done, we can work on a better testing.
@@ -414,7 +393,7 @@ def _check_config_params_when_transformer_enabled(self) -> None: | |||
f"({self.retrieval_intent})" if self.retrieval_intent else "" | |||
) | |||
self._warn_about_transformer_and_hidden_layers_enabled(selector_name) | |||
self._warn_and_correct_transformer_size(selector_name) | |||
self.component_config[TRANSFORMER_SIZE] = DEFAULT_TRANSFORMER_SIZE |
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.
We don't need this line here as the actual correction happens in _get_transformer_dimensions
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.
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.
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.
I'm aware of the error. Tests fail because we don't modify self.component_config
anymore so it keeps the old value. However this line still should be removed because correction happens in _get_transformer_dimensions
. We just need to come up with a different way of testing it. You can experiment a bit if you want to figure this out yourself, but if you find yourself stuck just ping me and I'll give you some insights.
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.
ok, thanks for the suggestions!!
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.
@jupyterjazz I'm stuck hahaha I'm trying to do this issue with a friend, it was our first issue in Rasa, so we don't know how to fix this tests :(
rasa/utils/tensorflow/rasa_layers.py
Outdated
f"`{TRANSFORMER_SIZE}` is set to " | ||
f"`{transformer_layers}` for " | ||
f"{attribute}, but a positive size is required when using " | ||
f"`{NUM_TRANSFORMER_LAYERS} > 0`. {attribute} will proceed, using " | ||
f"`{TRANSFORMER_SIZE}={DEFAULT_TRANSFORMER_SIZE}`. " | ||
f"Alternatively, specify a different value in the component's config.", | ||
category=UserWarning, | ||
) |
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.
_get_transformer_dimensions
can be called by three components ResponseSelector
, DIETClassifier
and TEDPolicy
. Since we don't know which one is calling (although correction would only happen inside ResponseSelector
because others have positive TRANSFORMER_SIZE
by default) we should change the warning message.
f"`{TRANSFORMER_SIZE}` is set to " | |
f"`{transformer_layers}` for " | |
f"{attribute}, but a positive size is required when using " | |
f"`{NUM_TRANSFORMER_LAYERS} > 0`. {attribute} will proceed, using " | |
f"`{TRANSFORMER_SIZE}={DEFAULT_TRANSFORMER_SIZE}`. " | |
f"Alternatively, specify a different value in the component's config.", | |
category=UserWarning, | |
) | |
f"`{TRANSFORMER_SIZE}` is set to " | |
f"`{transformer_units}`, " | |
f"but a positive size is required when using " | |
f"`{NUM_TRANSFORMER_LAYERS} > 0`. We will proceed, using " | |
f"`{TRANSFORMER_SIZE}={DEFAULT_TRANSFORMER_SIZE}`. " | |
f"Alternatively, specify a different value in the component's config.", | |
category=UserWarning, | |
) |
This way it's a bit non-specific but still understandable.
…and_correct_transformer_size
CHANGELOG.mdx
Outdated
### Miscellaneous internal changes | ||
- [#10712](https://github.com/RasaHQ/rasa/issues/10712): remove _warn_and_correct_transformer_size function as it's not needed anymore | ||
|
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.
You shouldn't directly edit CHANGELOG.mdx
. Here's one example of a changelog file:
Please follow the instructions given here and create a similar file.
@@ -414,7 +393,7 @@ def _check_config_params_when_transformer_enabled(self) -> None: | |||
f"({self.retrieval_intent})" if self.retrieval_intent else "" | |||
) | |||
self._warn_about_transformer_and_hidden_layers_enabled(selector_name) | |||
self._warn_and_correct_transformer_size(selector_name) | |||
self.component_config[TRANSFORMER_SIZE] = DEFAULT_TRANSFORMER_SIZE |
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.
I'm aware of the error. Tests fail because we don't modify self.component_config
anymore so it keeps the old value. However this line still should be removed because correction happens in _get_transformer_dimensions
. We just need to come up with a different way of testing it. You can experiment a bit if you want to figure this out yourself, but if you find yourself stuck just ping me and I'll give you some insights.
Just to let you know that I'm going to go back with this PR and @WashingtonBispo is going to help too |
…and_correct_transformer_size
…and_correct_transformer_size
hey @emysdias , is this still relevant / are you still planning on working on this? 🙂 |
I dont know, I got no answer anymore and not going to work on this anymore |
Hi there! Thanks for your contribution. As the PR has been stale for a while, I'm closing it. Please feel free to reopen an issue / PR if the problem still occurs on latest rasa versions. |
Proposed changes:
_warn_and_correct_transformer_size
as it's not needed anymore #10712Status (please check what you already did):
black
(please check Readme for instructions)