
    Pi	                     J    d dl Z d dlZd dlmZ d dlmZ  G d de          ZdS )    N)
Subcommand)get_all_recipesc                   P     e Zd ZdZdZdej        f fdZdej        ddfdZ	 xZ
S )	Listz1Holds all the logic for the `tune ls` subcommand.z<>
subparsersc           	          t                                                       |                    ddddt          j        d          t
          j                  | _        | j                            | j	                   d S )Nlsztune lsz%List all built-in recipes and configsa              examples:
                $ tune ls
                RECIPE                                   CONFIG
                full_finetune_single_device              llama2/7B_full_single_device
                full_finetune_distributed                llama2/7B_full
                                                         llama2/13B_full
                ...

            To run one of these recipes:
                $ tune run full_finetune_single_device --config full_finetune_single_device
            )proghelpdescriptionepilogformatter_class)func)
super__init__
add_parsertextwrapdedentargparseRawTextHelpFormatter_parserset_defaults_ls_cmd)selfr   	__class__s     e/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/torchtune/_cli/ls.pyr   zList.__init__   s    !,,8??  %9' - 
 
* 	!!t|!44444    argsreturnNc                 N   ddddd}t          |           t                      D ]}}|j        }t          |j                  dk    r|dd| j        d}t          |           t          |j                  D ]*\  }}|dk    rd}|dd|j        d}t          |           +~dS )z'List all available recipes and configs.RECIPEz<40 CONFIGr    N)printr   namelenconfigs
NULL_VALUE	enumerate)r   r   headerrecipe
recipe_strrowiconfigs           r   r   zList._ls_cmd-   s     1118111f &'' 	 	FJ6>""a''#???$/???c


&v~66  	6 q55!#J#;;;&+;;;c



	 	r   )__name__
__module____qualname____doc__r)   r   _SubParsersActionr   	Namespacer   __classcell__)r   s   @r   r   r      sw        ;;J58#= 5 5 5 5 5 52H. 4        r   r   )r   r   torchtune._cli.subcommandr   torchtune._recipe_registryr   r    r   r   <module>r;      sq      0 0 0 0 0 0 6 6 6 6 6 61 1 1 1 1: 1 1 1 1 1r   