File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -160,18 +160,27 @@ def _create_actor(self, **kwargs):
160160
161161 @property
162162 def _ray (self ):
163+ ray = self .__dict__ .get ("_ray_val" , None )
164+ if ray is not None :
165+ return ray
163166 # Import ray here to avoid requiring it as a dependency
164167 try :
165168 import ray
166169 except ImportError :
167170 raise ImportError (
168171 "Ray is required for RayTransform. Install with: pip install ray"
169172 )
173+ self .__dict__ ["_ray_val" ] = ray
170174 return ray
171175
172176 @_ray .setter
173177 def _ray (self , value ):
174- self ._ray = value
178+ self .__dict__ ["_ray_val" ] = value
179+
180+ def __getstate__ (self ):
181+ state = super ().__getstate__ ()
182+ state .pop ("_ray_val" , None )
183+ return state
175184
176185 def __init__ (
177186 self ,
You can’t perform that action at this time.
0 commit comments