-
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
Add support for different recipes #10641
Conversation
After removing autoconfigure module, following rename was done:
|
rasa/shared/importers/importer.py
Outdated
model_config = recipe.graph_config_for_recipe( | ||
config, cli_par, training_type=training_type, is_finetuning=is_finetuning, | ||
) | ||
return model_config |
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.
This is causing tests to fail because shared is not supposed to import anything from outside (ie. recipes).
rasa.shared.utils.io.write_yaml(invalid, config_file) | ||
|
||
with pytest.raises(YamlValidationException): | ||
TrainingDataImporter.load_from_config(str(config_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.
This test moved to tests/graph_components/validators/test_default_recipe_validator.py
as auto-config is dependent on recipe and not importer.
|
||
config = autoconfig.get_configuration(str(config_file)) | ||
|
||
assert config == {} |
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.
This test has been removed because importers will return empty dict without going through auto-config now on.
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.
All other tests in this file have been moved to tests/engine/recipes/test_default_recipe.py
because auto-config is recipe business.
Since now training type is used for auto-config
* fix over-indent in Tokenizers section of docs * add changelog * rename changelog from bug to docs
changelog/10473.feature.md
Outdated
Support other recipe types. | ||
|
||
This pull request also adds support for graph recipes, see details at | ||
https://rasa.com/docs/rasa/model-configuration check Graph Recipes section. |
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 guess you can use an anchor link to go directly to that section?
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.
It's a new page not an anchor and I can't link to it because it's not live yet, docs check fails with dead link :D
We now support graph recipes in addition to the default recipe. What graph recipes provide is more powerful control over how execution graph schemas are built. | ||
:::tip Default Recipe or Graph Recipe? | ||
|
||
You will probably only need graph recipes if you're running ML experiments or ablation studies on an existing model. We recommend starting with the default recipe and for many applications that will be all that's 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.
"ablation studies" feels a bit specific? (I had to google it 😁 )
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've used the exact wording from @rctatman actually and I had to google it too :D I think it is good because it has the effect of warning against using graph recipes if the user is not too advanced.
rasa/engine/recipes/graph_recipe.py
Outdated
if training_type == TrainingType.NLU: | ||
core_target = None | ||
else: | ||
core_target = config.get("core_target", "select_prediction") |
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.
Maybe it's better to fail fast rather than have a default?
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 more inclined towards "fail-safe" rather than "fail-fast" but @ka-bu had a similar opinion on another line where if config file changes between Rasa reading it and auto-configuring that we should fail instead of warning the user. She has a comment on this pull request. I feel defensive programming is better here as this is also the default target for default recipe? We could also add a warning log as a sort of a trade off? Otherwise I can also fail it :) Not too strong on this.
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 just thinking from a user perspective:
- User decides to create a new graph recipe config.
- They forget to add the targets
- They get an error saying that component
select_prediction
orRegexMessageHandler
does not exist in the schema. - They assume they are missing a required component, when actually the just need to configure the targets to fit their components.
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.
Added code to raise with a message if targets are missing.
Co-authored-by: Joe Juzl <[email protected]>
This reverts commit 998da42.
🚀 A preview of the docs have been deployed at the following URL: https://10641--rasahq-docs-rasa-v2.netlify.app/docs/rasa |
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.
🚀 🚀
Fixes #10473
Proposed changes:
Status (please check what you already did):
black
(please check Readme for instructions)