parse¶
- torchtune.config.parse(recipe_main: Callable[[DictConfig], Any]) Callable[[...], Any] [源代码]¶
用于处理配方的配置文件和 CLI 覆盖的装饰器。在配方的主函数上使用它。
- 参数:
recipe_main (配方) – 初始化并运行配方的主方法
示例
>>> @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
- 返回:
装饰后的 main
- 返回类型:
Callable[…, Any]