
    &`iI	                     x    d dl Z d dlZd dlmZ d dlmZmZ d dlmZ	 ddiZ
eeeddd	d
he	z  Z G d d          ZdS )    N)0COPY_DIRECTORY_CHECKPOINTS_INSTEAD_OF_MOVING_ENV)$ENABLE_V2_MIGRATION_WARNINGS_ENV_VARRAY_CHDIR_TO_TRIAL_DIR)ENV_VARS_TO_PROPAGATEPL_DISABLE_FORK1AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SECURITY_TOKENAWS_SESSION_TOKENc                       e Zd ZdZd Zd ZdS )_ActorClassCacheu  Caches actor classes.

    ray.remote is a registration call. It sends the serialized object to the
    key value store (redis), and will be fetched at an arbitrary worker
    later. Registration does not use any Ray scheduling resources.

    Later, class.remote() actually creates the remote actor. The
    actor will be instantiated on some arbitrary machine,
    according to the underlying Ray scheduler.

    Without this cache, you would register the same serialized object
    over and over again. Naturally, since redis doesn’t spill to disk,
    this can easily nuke the redis instance (and basically blow up Ray).
    This cache instead allows us to register once and only once.

    Note that we assume there can be multiple trainables in the
    system at once.
    c                     i | _         d S )N)_cache)selfs    r/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/tune/execution/class_cache.py__init__z_ActorClassCache.__init__5   s        c                    t                                           }t          D ]%}|t          j        v rt          j        |         ||<   &d|i}|| j        vr( t          j        |          |          }|| j        |<   | j        |         S )z;Gets the wrapped trainable_cls, otherwise calls ray.remote.env_vars)runtime_env)DEFAULT_ENV_VARScopyr   osenvironr   rayremote)r   trainable_clsr   env_var_to_propagater   
remote_clss         r   getz_ActorClassCache.get8   s    #((**$9 	R 	R #rz1113<P1Q-.!8,++<<<<]KKJ)3DK&{=))r   N)__name__
__module____qualname____doc__r   r!    r   r   r   r   !   s<         &  * * * * *r   r   )r   r   ray.air.constantsr   ray.train.constantsr   r    ray.train.v2._internal.constantsr   TRAIN_ENV_VARS_TO_PROPAGATEr   r   r&   r   r   <module>r+      s    				 



 N N N N N N             s  	9, ""  #* #* #* #* #* #* #* #* #* #*r   