
    g[	                     D    d dl mZ ddlmZmZ ddlmZ dZd Zd Z	d Z
d	S )
    )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   | j         }|.t          t                                                    rt          }n4t          |                                          st	          d| d          t          |          }|                    d          r|                    |           n|                    |           |S )zj
    Update an existing config file with the latest defaults while maintaining the old configuration.
    Nz"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      ]/var/www/html/ai-engine/env/lib/python3.11/site-packages/accelerate/commands/config/update.pyupdate_configr      s     "Kt$788??AA)+%%'' \ZkZZZ[[[";//FG$$ )K((((K(((    c                     |                      d|t          t                    } |                     dd d           |                     t
                     | S )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!   ,   sf    x{\sttF
"	  	 	 	 2333Mr   c                 J    t          |           }t          d| d           d S )Nz.Sucessfully updated the configuration file at .)r   print)r   r	   s     r   r   r   =   s/    %%K	
I;
I
I
IJJJJJr   N)pathlibr   config_argsr   r   config_utilsr   r   r   r!   r    r   r   <module>r)      s   "       C C C C C C C C 1 1 1 1 1 1 q  $  "K K K K Kr   