Shortcuts

解析

torchtune.config.parse(recipe_main: Callable[[DictConfig], Any]) Callable[[...], Any][source]

用于处理解析配置文件和命令行覆盖的装饰器 适用于一个配方。将其用于配方的主函数上。

Parameters:

recipe_main (Recipe) – 初始化和运行配方的主要方法

示例

>>> @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:

装饰后的主函数

Return type:

可调用[…, 任意]