parse¶
- torchtune.config.parse(recipe_main: Callable[[DictConfig], Any]) Callable[[Callable[[DictConfig], Any]], Any] [source]¶
Decorator that handles parsing the config file and CLI overrides for a recipe. Use it on the recipe’s main function.
- Parameters:
recipe_main (Recipe) – The main method that initializes and runs the recipe
Examples
>>> @parse >>> def main(cfg: DictConfig): >>> ...
>>> # With the decorator, the parameters will be parsed into cfg when run as: >>> tune my_recipe --config config.yaml foo=bar
- Returns:
the decorated main
- Return type:
Callable[[Recipe], Any]