Skip to content

Commit 0ecb9a0

Browse files
author
Verdi March
committed
Fix runproc.py generation
1 parent b2f4cb5 commit 0ecb9a0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/sagemaker/processing.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919
from __future__ import print_function, absolute_import
2020

21+
import json
2122
import os
2223
import pathlib
2324
import logging
@@ -1313,7 +1314,7 @@ def __init__(
13131314
inter-container traffic, security group IDs, and subnets (default: None).
13141315
"""
13151316
if not command:
1316-
command = ["python"]
1317+
command = ["python3"]
13171318

13181319
self.estimator_cls = estimator_cls
13191320
self.framework_version = framework_version
@@ -1644,14 +1645,11 @@ def _generate_framework_script(self, user_script: str) -> str:
16441645
16451646
subprocess.run(["pip", "install", "-r", "requirements.txt"])
16461647
1647-
cmd = ["{entry_point_command}", "{entry_point}"] + sys.argv[1:]
1648+
cmd = {entry_point_command} + sys.argv[1:]
16481649
print(' '.join(cmd))
16491650
subprocess.run(cmd)
16501651
"""
1651-
).format(
1652-
entry_point_command=" ".join(self.command),
1653-
entry_point=user_script,
1654-
)
1652+
).format(entry_point_command=json.dumps(self.command + [user_script]))
16551653

16561654
def _upload_payload(
16571655
self,

0 commit comments

Comments
 (0)