
    ;iy                     V    S SK Jr  \" 5       (       a  SSKJr  SSKJr  SS.S\4S	 jjrg
)   )is_tqdm_available    )tqdm   )PartialStateT)main_process_onlyr   c                 &   [        5       (       d  [        S5      e[        U5      S:  a#  [        US   [        5      (       a  [        S5      eUR                  SS5      nU (       a  U(       d  [        5       R                  S:g  n[        U0 UDSU0D6$ )z
Wrapper around `tqdm.tqdm` that optionally displays only on the main process.

Args:
    main_process_only (`bool`, *optional*):
        Whether to display the progress bar only on the main process
zZAccelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.r   zPassing `True` or `False` as the first argument to Accelerate's `tqdm` wrapper is unsupported. Please use the `main_process_only` keyword argument instead.disableF)
r   ImportErrorlen
isinstancebool
ValueErrorpopr   local_process_index_tqdm)r   argskwargsr
   s       e/home/dmtnaga/Documents/work/airagagent/rag_env/lib/python3.13/site-packages/accelerate/utils/tqdm.pyr   r      s     vww
4y1}DGT22K
 	
 jjE*G.449$2&2'22    N)importsr   	tqdm.autor   r   stater   r    r   r   <module>r      s,     ' '   +/ 34 3r   