File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1111# ANY KIND, either express or implied. See the License for the specific
1212# language governing permissions and limitations under the License.
1313"""This module contains functionality for the default handler service."""
14- from __future__ import absolute_import
1514
1615import os
16+ import sys
1717
1818from sagemaker_inference .transformer import Transformer
1919
@@ -57,10 +57,7 @@ def initialize(self, context):
5757 model_dir = properties .get ("model_dir" )
5858
5959 # add model_dir/code to python path
60- code_dir_path = "{}:" .format (model_dir + "/code" )
61- if PYTHON_PATH_ENV in os .environ :
62- os .environ [PYTHON_PATH_ENV ] = code_dir_path + os .environ [PYTHON_PATH_ENV ]
63- else :
64- os .environ [PYTHON_PATH_ENV ] = code_dir_path
60+ code_dir_path = model_dir + "/code"
61+ sys .path .insert (1 , code_dir_path )
6562
6663 self ._service .validate_and_initialize (model_dir = model_dir , context = context )
You can’t perform that action at this time.
0 commit comments