o
    )iy                     @   sB   d dl mZ e rddlmZ ddlmZ dddefd	d
ZdS )   )is_tqdm_available    )tqdm   )PartialStateT)main_process_onlyr   c                 O   sf   t  stdt|dkrt|d trtd|dd}| r(|s(t jdk}t	|i |d|iS )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    r   R/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/accelerate/utils/tqdm.pyr      s   r   N)importsr   	tqdm.autor   r   stater   r   r   r   r   r   <module>   s
   