Skip to content

Commit 3f393ca

Browse files
committed
add /opt/ml/model/code to PYTHONPATH for SDK-packaged tarballs
1 parent 639df69 commit 3f393ca

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/ray/dockerd_entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ else
1212
fi
1313
echo "Detected ${NUM_GPUS} GPU(s)"
1414

15-
# Add model directory to Python path
16-
export PYTHONPATH="/opt/ml/model:${PYTHONPATH}"
15+
# Add model directory and SDK code/ subdir to Python path
16+
export PYTHONPATH="/opt/ml/model:/opt/ml/model/code:${PYTHONPATH}"
1717

1818
# Install runtime requirements if present
1919
if [ -f "/opt/ml/model/code/requirements.txt" ]; then

scripts/ray/sagemaker_entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ echo "Detected ${NUM_GPUS} GPU(s)"
1919
if [ $# -eq 0 ] || [ "$1" = "serve" ]; then
2020
echo "Starting Ray Serve for SageMaker..."
2121

22-
# Add model directory to Python path before ray start
23-
export PYTHONPATH="/opt/ml/model:${PYTHONPATH}"
22+
# Add model directory and SDK code/ subdir to Python path before ray start
23+
export PYTHONPATH="/opt/ml/model:/opt/ml/model/code:${PYTHONPATH}"
2424

2525
# Install runtime requirements before Ray starts
2626
if [ -f "/opt/ml/model/code/requirements.txt" ]; then

0 commit comments

Comments
 (0)