2323from sagemaker .processing import ScriptProcessor
2424
2525
26- _PYTHON_VERSION_TO_COMMAND_MAPPING = {"py2" : ["python2" ], "py3" : ["python3" ]}
27- _VALID_PYTHON_VERSIONS = ["py2" , "py3" ]
28-
29-
3026class SKLearnProcessor (ScriptProcessor ):
3127 """Handles Amazon SageMaker processing tasks for jobs using scikit-learn."""
3228
@@ -37,7 +33,6 @@ def __init__(
3733 instance_type ,
3834 instance_count ,
3935 command = None ,
40- py_version = "py3" ,
4136 volume_size_in_gb = 30 ,
4237 volume_kms_key = None ,
4338 output_kms_key = None ,
@@ -65,7 +60,6 @@ def __init__(
6560 command ([str]): The command to run, along with any command-line flags.
6661 Example: ["python3", "-v"]. If not provided, ["python3"] or ["python2"]
6762 will be chosen based on the py_version parameter.
68- py_version (str): The python version to use, for example, 'py3'.
6963 volume_size_in_gb (int): Size in GB of the EBS volume to
7064 use for storing data during processing (default: 30).
7165 volume_kms_key (str): A KMS key for the processing
@@ -90,15 +84,10 @@ def __init__(
9084 session = sagemaker_session or Session ()
9185 region = session .boto_region_name
9286
93- if py_version not in _VALID_PYTHON_VERSIONS :
94- raise ValueError (
95- "'py_version' must be a valid value. Please provide one of: 'py2', 'py3'"
96- )
97-
9887 if not command :
99- command = _PYTHON_VERSION_TO_COMMAND_MAPPING [ py_version ]
88+ command = [ "python3" ]
10089
101- image_tag = "{}-{}-{}" .format (framework_version , "cpu" , py_version )
90+ image_tag = "{}-{}-{}" .format (framework_version , "cpu" , "py3" )
10291 image_uri = default_framework_uri ("scikit-learn" , region , image_tag )
10392
10493 super (SKLearnProcessor , self ).__init__ (
0 commit comments