-
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
remove _warn_and_correct_transformer_size funct #10819
Changes from 5 commits
9db1876
88c1b11
5763323
26dd3f5
d543349
00b3401
24e4a52
58cbbcd
898f1ae
cc2f1a6
f299b5d
b8ca0e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -382,27 +382,6 @@ def _warn_about_transformer_and_hidden_layers_enabled( | |
category=UserWarning, | ||
) | ||
|
||
def _warn_and_correct_transformer_size(self, selector_name: Text) -> None: | ||
"""Corrects transformer size so that training doesn't break; informs the user. | ||
|
||
If a transformer is used, the default `transformer_size` breaks things. | ||
We need to set a reasonable default value so that the model works fine. | ||
""" | ||
if ( | ||
self.component_config[TRANSFORMER_SIZE] is None | ||
or self.component_config[TRANSFORMER_SIZE] < 1 | ||
): | ||
rasa.shared.utils.io.raise_warning( | ||
f"`{TRANSFORMER_SIZE}` is set to " | ||
f"`{self.component_config[TRANSFORMER_SIZE]}` for " | ||
f"{selector_name}, but a positive size is required when using " | ||
f"`{NUM_TRANSFORMER_LAYERS} > 0`. {selector_name} will proceed, using " | ||
f"`{TRANSFORMER_SIZE}={DEFAULT_TRANSFORMER_SIZE}`. " | ||
f"Alternatively, specify a different value in the component's config.", | ||
category=UserWarning, | ||
) | ||
self.component_config[TRANSFORMER_SIZE] = DEFAULT_TRANSFORMER_SIZE | ||
|
||
def _check_config_params_when_transformer_enabled(self) -> None: | ||
"""Checks & corrects config parameters when the transformer is enabled. | ||
|
||
|
@@ -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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 :( |
||
|
||
def _check_config_parameters(self) -> None: | ||
"""Checks that component configuration makes sense; corrects it where needed.""" | ||
|
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.