Buckets:

hf-doc-build/doc-dev / sagemaker /pr_2709 /en /tutorials /sagemaker-sdk /sagemaker-sdk-quickstart.html
download
raw
23.6 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Amazon SageMaker SDK Quickstart&quot;,&quot;local&quot;:&quot;amazon-sagemaker-sdk-quickstart&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Deploy a model from the Hub&quot;,&quot;local&quot;:&quot;deploy-a-model-from-the-hub&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Invoke the endpoint&quot;,&quot;local&quot;:&quot;invoke-the-endpoint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Clean up&quot;,&quot;local&quot;:&quot;clean-up&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;What’s next&quot;,&quot;local&quot;:&quot;whats-next&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/>
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/entry/start.COiK-bUV.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/UGDyBJsP.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/Paddn1qZ.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/entry/app.CjYANwwM.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/Beft82ym.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/Ds9Xs-bq.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/DnXYL5Yp.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/nodes/0.CsY3iCn7.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/CxJVP3KE.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/nodes/28.tJRc_8xX.js" rel="modulepreload">
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/chunks/Cz9gzD1e.js" rel="modulepreload">
<!--132p78k--><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Amazon SageMaker SDK Quickstart&quot;,&quot;local&quot;:&quot;amazon-sagemaker-sdk-quickstart&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Deploy a model from the Hub&quot;,&quot;local&quot;:&quot;deploy-a-model-from-the-hub&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Invoke the endpoint&quot;,&quot;local&quot;:&quot;invoke-the-endpoint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Clean up&quot;,&quot;local&quot;:&quot;clean-up&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;What’s next&quot;,&quot;local&quot;:&quot;whats-next&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/sagemaker/pr_2709/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="amazon-sagemaker-sdk-quickstart" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#amazon-sagemaker-sdk-quickstart"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Amazon SageMaker SDK Quickstart</span></h1><!--]--><!----> <p>Deploy a model from the Hugging Face Hub to a live SageMaker endpoint in a few minutes with the SageMaker Python SDK.</p> <div class="grid grid-cols-1 gap-4 sm:grid-cols-3 my-6 not-prose"><div class="rounded-xl border border-gray-200 px-5 py-4 dark:border-gray-800"><div class="text-sm font-semibold text-orange-600 dark:text-orange-300">1 · Deploy</div> <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">Point ModelBuilder at a Hub model ID and create the endpoint.</p></div> <div class="rounded-xl border border-gray-200 px-5 py-4 dark:border-gray-800"><div class="text-sm font-semibold text-orange-600 dark:text-orange-300">2 · Invoke</div> <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">Send a JSON request to the live endpoint and get a prediction.</p></div> <div class="rounded-xl border border-gray-200 px-5 py-4 dark:border-gray-800"><div class="text-sm font-semibold text-orange-600 dark:text-orange-300">3 · Delete</div> <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">One call deletes the endpoint and stops all charges.</p></div></div> <!--[1--><h2 class="relative group"><a id="prerequisites" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#prerequisites"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Prerequisites</span></h2><!--]--><!----> <ul><li>An AWS account. If you do not have one, follow the <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html" rel="nofollow">AWS setup guide</a>.</li> <li>The SageMaker Python SDK v3, which provides <code>ModelBuilder</code> for inference and <code>ModelTrainer</code> for training:</li></ul> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-bash "><!---->pip install <span class="hljs-string">&quot;sagemaker&gt;=3.0.0&quot;</span><!----></pre></div><!----> <ul><li>An IAM execution role. In SageMaker Studio or on a SageMaker notebook instance, <code>get_execution_role()</code> returns it automatically. In a local environment you must pass the role ARN yourself — both setups are shown in <a href="./setup-sagemaker-sdk">Set up the SageMaker SDK</a>.</li></ul> <!--[1--><h2 class="relative group"><a id="deploy-a-model-from-the-hub" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#deploy-a-model-from-the-hub"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Deploy a model from the Hub</span></h2><!--]--><!----> <p>Create a session, then point <code>ModelBuilder</code> at a model ID from the Hub:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-python "><!----><span class="hljs-keyword">from</span> sagemaker.core.helper.session_helper <span class="hljs-keyword">import</span> Session, get_execution_role
<span class="hljs-keyword">from</span> sagemaker.serve <span class="hljs-keyword">import</span> ModelBuilder, ModelServer
<span class="hljs-keyword">from</span> sagemaker.serve.builder.schema_builder <span class="hljs-keyword">import</span> SchemaBuilder
<span class="hljs-keyword">from</span> sagemaker.core <span class="hljs-keyword">import</span> image_uris
sess = Session()
role = get_execution_role()
<span class="hljs-comment"># any Hub model works</span>
model_id = <span class="hljs-string">&quot;cardiffnlp/twitter-roberta-base-sentiment-latest&quot;</span>
instance_type = <span class="hljs-string">&quot;ml.m5.xlarge&quot;</span>
<span class="hljs-comment"># Retrieve the Hugging Face PyTorch inference DLC image URI</span>
inference_image = image_uris.retrieve(
framework=<span class="hljs-string">&quot;huggingface&quot;</span>,
region=sess.boto_region_name,
<span class="hljs-comment"># Transformers version</span>
version=<span class="hljs-string">&quot;4.51.3&quot;</span>,
base_framework_version=<span class="hljs-string">&quot;pytorch2.6.0&quot;</span>, <span class="hljs-comment"># PyTorch version</span>
<span class="hljs-comment"># Python version</span>
py_version=<span class="hljs-string">&quot;py312&quot;</span>,
image_scope=<span class="hljs-string">&quot;inference&quot;</span>,
instance_type=instance_type,
)
<span class="hljs-comment"># Sample request/response used by ModelBuilder to set up serialization</span>
sample_input = {<span class="hljs-string">&quot;inputs&quot;</span>: <span class="hljs-string">&quot;I love how simple this was!&quot;</span>}
sample_output = [{<span class="hljs-string">&quot;label&quot;</span>: <span class="hljs-string">&quot;positive&quot;</span>, <span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-number">0.99</span>}]
model_builder = ModelBuilder(
<span class="hljs-comment"># Hub model ID, loaded at deploy time</span>
model=model_id,
model_server=ModelServer.MMS,
image_uri=inference_image,
<span class="hljs-comment"># tells the Inference Toolkit which pipeline to serve</span>
env_vars={<span class="hljs-string">&quot;HF_TASK&quot;</span>: <span class="hljs-string">&quot;text-classification&quot;</span>},
role_arn=role,
sagemaker_session=sess,
instance_type=instance_type,
schema_builder=SchemaBuilder(sample_input=sample_input, sample_output=sample_output),
)
model_builder.build()
predictor = model_builder.deploy(initial_instance_count=<span class="hljs-number">1</span>, instance_type=instance_type)<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="invoke-the-endpoint" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#invoke-the-endpoint"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Invoke the endpoint</span></h2><!--]--><!----> <p>The request and response bodies are JSON, and every request needs an <code>inputs</code> key:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-python "><!----><span class="hljs-keyword">import</span> json
res = predictor.invoke(
body=json.dumps({<span class="hljs-string">&quot;inputs&quot;</span>: <span class="hljs-string">&quot;I love how simple this was!&quot;</span>}),
content_type=<span class="hljs-string">&quot;application/json&quot;</span>,
)
<span class="hljs-built_in">print</span>(json.loads(res.body.read()))<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="clean-up" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#clean-up"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>Clean up</span></h2><!--]--><!----> <p>Delete the endpoint when you are done:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> Copied</div><!----></button><!----></div> <pre class="language-python "><!---->predictor.delete()<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="whats-next" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#whats-next"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span>What’s next</span></h2><!--]--><!----> <ul><li><a href="./deploy-sagemaker-sdk">Deploy models</a> covers deploying models you trained in SageMaker or stored in S3, batch transform jobs, and custom inference code.</li> <li><a href="./training-sagemaker-sdk">Train models</a> covers <code>ModelTrainer</code>: training scripts, distributed training, spot instances, and metrics.</li> <li>For a full LLM recipe, see the example <a href="../../examples/sagemaker-sdk-fine-tune-trl-cli">Fine-Tuning LLMs with TRL CLI on SageMaker</a>.</li></ul> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/hub-docs/blob/main/docs/sagemaker/source/tutorials/sagemaker-sdk/sagemaker-sdk-quickstart.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg><!----> <span><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!----><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]-->
<script>
{
__sveltekit_dwws3f = {
base: "/docs/sagemaker/pr_2709/en",
assets: "/docs/sagemaker/pr_2709/en"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/docs/sagemaker/pr_2709/en/_app/immutable/entry/start.COiK-bUV.js"),
import("/docs/sagemaker/pr_2709/en/_app/immutable/entry/app.CjYANwwM.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 28],
data: [null,null],
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
23.6 kB
·
Xet hash:
9c01ec530f3caa76c99ba9cadddd0a893c59185cdb627d359282e95f6d5a8b7f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.