
    qi                         d Z ddlZddlZddlZddlZddlmZ ddlZddlZddl	m
Z
 ddlmZ ddlmZmZmZmZmZ 	 ddeedz   ej(                  d	
      f   ddfdZddZdedefdZy)zContains commands to print information about the environment and version.

Usage:
    transformers env
    transformers version
    N)	Annotated   )__version__)is_deepspeed_available)is_accelerate_availableis_torch_availableis_torch_hpu_availableis_torch_npu_availableis_torch_xpu_availableaccelerate_config_filezQThe accelerate config file to use for the default values in the launching script.)helpreturnc                 V   ddl }|j                  }d}dx}}t               rddl}ddlm}m} |j                  }| t        j                  j                  |      r ||       j                         }t        |t              r8dj                  |j                         D 	
cg c]  \  }	}
d|	 d|
  c}
}	      nd	| }d}d
}d
}t               r[ddl}|j                  }|j"                  j%                         }t'               }t)               }t+               }|rd}n|rd}n	|rd}n|rd}d}t-               r@t/        j0                  t3        j4                               5  ddl}ddd       j                  }t        t9        j8                         t9        j:                         t<        j                  | | | | | d| ddd
}t               r|r#d|d<   j"                  j?                         |d<   nr#d|d<   j@                  j?                         |d<   nbr#d|d<   jB                  j?                         |d<   n=r;d|d<   jD                  j?                         |d<   |jF                  jH                  |d<   tK        d       tK        tM        |             |S c c}
}	w # 1 sw Y   @xY w)z(Print information about the environment.r   Nznot installedz	not found)default_config_fileload_config_from_file
z	- : 	NACUDAXPUNPUHPUz ()z	<fill in>)
z`transformers` versionPlatformzPython versionzHuggingface_hub versionzSafetensors versionzAccelerate versionzAccelerate configzDeepSpeed versionzPyTorch version (accelerator?)z/Using distributed or parallel set-up in script?zUsing GPU in script?zGPU typezUsing XPU in script?zXPU typezUsing HPU in script?zHPU typezUsing NPU in script?zNPU typezCANN versionzV
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
)'safetensorsr   r   
accelerateaccelerate.commands.configr   r   ospathisfileto_dict
isinstancedictjoinitemsr   torchcudais_availabler   r
   r	   r   
contextlibredirect_stdoutioStringIO	deepspeedplatformpython_versionhuggingface_hubget_device_namexpuhpunpuversioncannprint_format_dict)r   r   safetensors_versionaccelerate_versionaccelerate_configaccelerate_config_strr   r   r   propval
pt_versionpt_cuda_availablept_acceleratorr'   pt_xpu_availablept_npu_availablept_hpu_availabledeepspeed_versionr.   infos                        I/opt/pipecat/venv/lib/python3.12/site-packages/transformers/cli/system.pyenvrI   )   s    %11(0;;- Y'33!-@S1T 56L M U U W +T2 II=N=T=T=VW	cdV2cU+WX'() 	 !JN&&
!JJ335131313#N"N"N"N'''6 		%11 #.%%'"113#2#>#>"5!6!3 4 56 12-7L>:J!*L;FD +6D'($zz99;D+6D'($yy88:D+6D'($yy88:D+6D'($yy88:D#(==#5#5D 	
de	,t
K X:	 	s   J
JJ(c                  "    t        t               y)zPrint CLI version.N)r8   r        rH   r6   r6      s
    	+rL   dc           
          dj                  | j                         D cg c]  \  }}d| d|  c}}      dz   S c c}}w )Nr   z- r   )r%   r&   )rM   r>   r?   s      rH   r9   r9      s;    99!'')DYT34&3%(DELLDs   <
)N)r   N)__doc__r*   r,   r   r/   typingr   r1   typer r   integrations.deepspeedr   utilsr   r   r	   r
   r   strArgumentrI   r6   r$   r9   rK   rL   rH   <module>rW      s     	 	      ;  		W%d
op	rW
 
Wt
MD MS MrL   