
    ;i\	                     B    S SK Jr  SSKJrJr  SSKJr  SrS rS r	S r
g	)
    )Path   )default_config_fileload_config_from_file)SubcommandHelpFormatterz`Update an existing config file with the latest defaults while maintaining the old configuration.c                 Z   U R                   nUc)  [        [        5      R                  5       (       a  [        nO-[        U5      R                  5       (       d  [	        SU S35      e[        U5      nUR                  S5      (       a  UR                  U5        U$ UR                  U5        U$ )zb
Update an existing config file with the latest defaults while maintaining the old configuration.
z"The passed config file located at z doesn't exist.z.json)	config_filer   r   exists
ValueErrorr   endswithto_json_fileto_yaml_file)argsr	   configs      q/home/dmtnaga/Documents/work/airagagent/rag_env/lib/python3.13/site-packages/accelerate/commands/config/update.pyupdate_configr      s     ""Kt$78??AA)+%%''=k]/Z[[";/FG$$K(  	K(    c                     U R                  SU[        [        S9n U R                  SS SS9  U R	                  [
        S9  U $ )Nupdate)parentshelpformatter_classz--config_fileaQ  The path to the config file to update. Will default to a file named default_config.yaml in the cache location, which is the content of the environment `HF_HOME` suffixed with 'accelerate', or if you don't have such an environment variable, your cache directory ('~/.cache' or the content of `XDG_CACHE_HOME`) suffixed with 'huggingface'.)defaultr   )func)
add_parserdescriptionr   add_argumentset_defaultsupdate_config_command)parserr   s     r   update_command_parserr!   ,   sS    x{\stF
"	  	 23Mr   c                 8    [        U 5      n[        SU S35        g )Nz/Successfully updated the configuration file at .)r   print)r   r	   s     r   r   r   =   s    %K	;K=
JKr   N)pathlibr   config_argsr   r   config_utilsr   r   r   r!   r    r   r   <module>r)      s(   "  C 1 q$"Lr   