
     i                     4    d dl Z d dlZd dlmZ d dlZdefdZy)    N)Randomreturnc                    t               }t        j                  j                  dd      }t        j
                  j                  j                         }|d}n|j                  }||| j                  | j                  | j                  f}t        j                  t        |      j                               }|j!                  |       |S )zCreate worker-specific random number generator

    This makes sure that
    1. training samples generation is reproducible
    2. every (worker, epoch) uses a different seed

    Parameters
    ----------
    epoch : int
        Current epoch.
    PL_GLOBAL_SEEDunsetN)r   osenvirongettorchutilsdataget_worker_infoid
local_rankglobal_rankcurrent_epochzlibadler32strencodeseed)modelrngglobal_seedworker_info	worker_id
seed_tupler   s          p/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/pyannote/audio/utils/random.pycreate_rng_for_workerr      s     (C**..!17;K++""224K	NN	 	J <<J..01DHHTNJ    )r   r   randomr   r   r    r    r   <module>r#      s   0 
   #F #r    