Skip to content

Commit

Permalink
[doc] [data] Fix a couple stray broken tests still (#35011)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericl authored May 3, 2023
1 parent 5759c41 commit 41ad9ca
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion doc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ py_test_run_all_subdirectory(
include = ["source/data/doc_code/*.py"],
exclude = [
"source/ray-air/doc_code/predictors.py",
"source/data/doc_code/loading_data_untested.py"
"source/data/doc_code/loading_data_untested.py",
"source/data/doc_code/torch_image_batch_trained.py"
],
extra_srcs = [],
tags = ["exclusive", "team:data"],
Expand Down
4 changes: 2 additions & 2 deletions doc/source/data/doc_code/torch_image_batch_trained.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# isort: skip_file
# fmt: off

ray.init(num_gpus=4)

# __pt_load_start__
import ray

ray.init(num_gpus=4)

data_url = "s3://anonymous@air-example-data-2/1G-image-data-synthetic-raw" # <1>
ds = ray.data.read_images(data_url).limit(1000) # <2>
# __pt_load_end__
Expand Down
2 changes: 1 addition & 1 deletion doc/source/ray-air/examples/gptj_batch_prediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
" batch_size=4,\n",
" fn_constructor_kwargs=dict(model_id=model_id, revision=revision),\n",
" batch_format=\"pandas\",\n",
" compute=\"actors\",\n",
" compute=ray.data.ActorPoolStrategy(),\n",
" num_gpus=1,\n",
" )\n",
")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
" PredictCallable,\n",
" batch_size=1,\n",
" fn_constructor_kwargs=dict(model_id=model_id),\n",
" compute=\"actors\",\n",
" compute=ray.data.ActorPoolStrategy(),\n",
" batch_format=\"pandas\",\n",
" num_gpus=1,\n",
")\n",
Expand Down
2 changes: 2 additions & 0 deletions python/ray/data/datastream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4377,6 +4377,8 @@ def __setstate__(self, state):
self._current_executor = None

def __del__(self):
if sys.meta_path is None:
return
if self._current_executor and ray is not None and ray.is_initialized():
self._current_executor.shutdown()

Expand Down

0 comments on commit 41ad9ca

Please sign in to comment.