File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11
11
# ANY KIND, either express or implied. See the License for the specific
12
12
# language governing permissions and limitations under the License.
13
13
"""This module contains functionality for the default handler service."""
14
- from __future__ import absolute_import
15
14
16
15
import os
16
+ import sys
17
17
18
18
from sagemaker_inference .transformer import Transformer
19
19
@@ -57,10 +57,7 @@ def initialize(self, context):
57
57
model_dir = properties .get ("model_dir" )
58
58
59
59
# 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 )
65
62
66
63
self ._service .validate_and_initialize (model_dir = model_dir , context = context )
You can’t perform that action at this time.
0 commit comments