U
    0-e                     @   sH   d dl Z d dlZd dlmZ d
ddZdd Zdd Zed	krDe  dS )    N)execute_subprocess_asyncc                 C   sF   | d k	r|  d}n
td}|jdd dd | d k	rB|jtd |S )NtestzAccelerate test commandz--config_fileaT  The path to use to store the config file. 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'.)defaulthelp)func)
add_parserargparseArgumentParseradd_argumentset_defaultstest_command)Z
subparsersparser r   Y/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/accelerate/commands/test.pytest_command_parser   s    
r   c                 C   s   t jjtt jjd d dddg }| jd kr:|}nd| j d| }dg|  }t|t j	 d}|j
d	kr~td
 d S )NZ
test_utilsscriptsztest_script.pyz--config_file= zaccelerate-launch)envr   z?Test is a success! You are ready for your distributed training!)ospathsepjoin__file__splitconfig_filer   environcopy
returncodeprint)argsscript_nameZ	test_argscmdresultr   r   r   r   -   s    *

r   c                  C   s   t  } |  }t| d S )N)r   
parse_argsr   )r   r    r   r   r   main;   s    r%   __main__)N)r   r   Zaccelerate.test_utilsr   r   r   r%   __name__r   r   r   r   <module>   s   
