Buckets:
| import{s as Ze,b as Ne,n as Ee,o as xe}from"../chunks/scheduler.aec39e6a.js";import{S as _e,i as Ae,e as i,s,c as p,h as He,a as o,d as a,b as n,f as Ge,g as m,j as r,k as f,l as Fe,m as l,n as u,t as M,o as y,p as d}from"../chunks/index.4ee0a2d0.js";import{C as Ve,H,E as Re}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.192ad1b8.js";import{C as we}from"../chunks/CodeBlock.e9db4fe4.js";function Xe(Ue){let c,R,F,X,w,L,U,Y,J,z,C,Je='Amazon SageMaker JumpStart lets you deploy the most-popular open Hugging Face models with one click—inside your own AWS account. JumpStart offers a curated <a href="https://aws.amazon.com/sagemaker-ai/jumpstart/getting-started/?sagemaker-jumpstart-cards.sort-by=item.additionalFields.model-name&sagemaker-jumpstart-cards.sort-order=asc&awsf.sagemaker-jumpstart-filter-product-type=*all&awsf.sagemaker-jumpstart-filter-text=*all&awsf.sagemaker-jumpstart-filter-vision=*all&awsf.sagemaker-jumpstart-filter-tabular=*all&awsf.sagemaker-jumpstart-filter-audio-tasks=*all&awsf.sagemaker-jumpstart-filter-multimodal=*all&awsf.sagemaker-jumpstart-filter-RL=*all&awsm.page-sagemaker-jumpstart-cards=1&sagemaker-jumpstart-cards.q=qwen&sagemaker-jumpstart-cards.q_operator=AND" rel="nofollow">selection</a> of model checkpoints for various tasks, including text generation, embeddings, vision, audio, and more. Most models are deployed using the official <a href="https://huggingface.co/docs/sagemaker/main/en/dlcs/introduction" rel="nofollow">Hugging Face Deep Learning Containers</a> with a sensible default instance type, so you can move from idea to production in minutes.',P,j,Ce='In this quickstart guide, we will deploy <a href="https://huggingface.co/Qwen/Qwen2.5-14B-Instruct" rel="nofollow">Qwen/Qwen2.5-14B-Instruct</a>.',D,T,K,k,je='<thead><tr><th></th> <th>Requirement</th></tr></thead> <tbody><tr><td>AWS account with SageMaker enabled</td> <td>An AWS account that will contain all your AWS resources.</td></tr> <tr><td>An IAM role to access SageMaker AI</td> <td>Learn more about how IAM works with SageMaker AI in this <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/security-iam.html" rel="nofollow">guide</a>.</td></tr> <tr><td>SageMaker Studio domain and user profile</td> <td>We recommend using SageMaker Studio for straightforward deployment and inference. Follow this <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/onboard-quick-start.html" rel="nofollow">guide</a>.</td></tr> <tr><td>Service quotas</td> <td>Most LLMs need GPU instances (e.g. ml.g5). Verify you have quota for <code>ml.g5.24xlarge</code> or <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/canvas-requesting-quota-increases.html" rel="nofollow">request it</a>.</td></tr></tbody>',O,b,Te='<p>[!WARNING][SageMaker Python SDK v3 has been recently released](<a href="https://github.com/aws/sagemaker-python-sdk" rel="nofollow">https://github.com/aws/sagemaker-python-sdk</a>), so unless specified otherwise, all the documentation and tutorials are still using the <a href="https://github.com/aws/sagemaker-python-sdk/tree/master-v2" rel="nofollow">SageMaker Python SDK v2</a>. We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as <code>pip install "sagemaker<3.0.0"</code>.</p>',ee,$,te,I,ke="Let’s explain how you would deploy a Hugging Face model to SageMaker browsing through the Jumpstart catalog:",ae,S,be="<li>Open SageMaker → JumpStart.</li> <li>Filter “Hugging Face” or search for your model (e.g. Qwen2.5-14B).</li> <li>Click Deploy → (optional) adjust instance size / count → Deploy.</li> <li>Wait until Endpoints shows In service.</li> <li>Copy the Endpoint name (or ARN) for later use.</li>",le,g,$e,se,v,Ie="Alternatively, you can also browse through the Hugging Face Model Hub:",ne,B,Se="<li>Open the model page → Click Deploy → SageMaker → Jumpstart tab if model is available.</li> <li>Copy the code snippet and use it from a SageMaker Notebook instance.</li>",ie,h,ve,oe,q,re,W,Be="The endpoint creation can take several minutes, depending on the size of the model.",pe,Q,me,N,qe="If you deployed through the console, you need to grab the endpoint ARN and reuse in your code.",ue,G,Me,Z,We="The endpoint support the Open AI API specification.",ye,E,de,x,Qe="To avoid incurring unnecessary costs, when you’re done, delete the SageMaker endpoints in the Deployments → Endpoints console or using the following code snippets:",ce,_,ge,A,he,V,fe;return w=new Ve({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),U=new H({props:{title:"Quickstart - Deploy Hugging Face Models with SageMaker Jumpstart",local:"quickstart---deploy-hugging-face-models-with-sagemaker-jumpstart",headingTag:"h1"}}),J=new H({props:{title:"Why use SageMaker JumpStart for Hugging Face models?",local:"why-use-sagemaker-jumpstart-for-hugging-face-models",headingTag:"h2"}}),T=new H({props:{title:"1. Prerequisites",local:"1-prerequisites",headingTag:"h2"}}),$=new H({props:{title:"2· Endpoint deployment",local:"2-endpoint-deployment",headingTag:"h2"}}),q=new we({props:{code:"JTIzJTIwU2FnZU1ha2VyJTIwSnVtcFN0YXJ0JTIwcHJvdmlkZXMlMjBBUElzJTIwYXMlMjBwYXJ0JTIwb2YlMjBTYWdlTWFrZXIlMjBTREslMjB0aGF0JTIwYWxsb3clMjB5b3UlMjB0byUyMGRlcGxveSUyMGFuZCUyMGZpbmUtdHVuZSUyMG1vZGVscyUyMGluJTIwbmV0d29yayUyMGlzb2xhdGlvbiUyMHVzaW5nJTIwc2NyaXB0cyUyMHRoYXQlMjBTYWdlTWFrZXIlMjBtYWludGFpbnMuJTBBJTBBZnJvbSUyMHNhZ2VtYWtlci5qdW1wc3RhcnQubW9kZWwlMjBpbXBvcnQlMjBKdW1wU3RhcnRNb2RlbCUwQSUwQSUwQW1vZGVsJTIwJTNEJTIwSnVtcFN0YXJ0TW9kZWwobW9kZWxfaWQlM0QlMjJodWdnaW5nZmFjZS1sbG0tcXdlbjItNS0xNGItaW5zdHJ1Y3QlMjIpJTBBZXhhbXBsZV9wYXlsb2FkcyUyMCUzRCUyMG1vZGVsLnJldHJpZXZlX2FsbF9leGFtcGxlcygpJTBBJTBBcHJlZGljdG9yJTIwJTNEJTIwbW9kZWwuZGVwbG95KCklMEElMEFmb3IlMjBwYXlsb2FkJTIwaW4lMjBleGFtcGxlX3BheWxvYWRzJTNBJTBBJTIwJTIwJTIwJTIwcmVzcG9uc2UlMjAlM0QlMjBwcmVkaWN0b3IucHJlZGljdChwYXlsb2FkLmJvZHkpJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIySW5wdXQlM0ElNUNuJTIyJTJDJTIwcGF5bG9hZC5ib2R5JTVCcGF5bG9hZC5wcm9tcHRfa2V5JTVEKSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMk91dHB1dCUzQSU1Q24lMjIlMkMlMjByZXNwb25zZSU1QjAlNUQlNUIlMjJnZW5lcmF0ZWRfdGV4dCUyMiU1RCUyQyUyMCUyMiU1Q24lNUNuJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTNEJTVDbiUyMik=",highlighted:`<span class="hljs-comment"># SageMaker JumpStart provides APIs as part of SageMaker SDK that allow you to deploy and fine-tune models in network isolation using scripts that SageMaker maintains.</span> | |
| <span class="hljs-keyword">from</span> sagemaker.jumpstart.model <span class="hljs-keyword">import</span> JumpStartModel | |
| model = JumpStartModel(model_id=<span class="hljs-string">"huggingface-llm-qwen2-5-14b-instruct"</span>) | |
| example_payloads = model.retrieve_all_examples() | |
| predictor = model.deploy() | |
| <span class="hljs-keyword">for</span> payload <span class="hljs-keyword">in</span> example_payloads: | |
| response = predictor.predict(payload.body) | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">"Input:\\n"</span>, payload.body[payload.prompt_key]) | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">"Output:\\n"</span>, response[<span class="hljs-number">0</span>][<span class="hljs-string">"generated_text"</span>], <span class="hljs-string">"\\n\\n===============\\n"</span>)`,wrap:!1}}),Q=new H({props:{title:"3. Test interactively",local:"3-test-interactively",headingTag:"h2"}}),G=new we({props:{code:"ZnJvbSUyMHNhZ2VtYWtlci5wcmVkaWN0b3IlMjBpbXBvcnQlMjByZXRyaWV2ZV9kZWZhdWx0JTBBZW5kcG9pbnR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CUyMnN0cmVhbSUyMiUzQSUyMEZhbHNlJTBBJTdEJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjBwcmVkaWN0b3IucHJlZGljdChwYXlsb2FkKSUwQXByaW50KHJlc3BvbnNlKQ==",highlighted:`<span class="hljs-keyword">from</span> sagemaker.predictor <span class="hljs-keyword">import</span> retrieve_default | |
| endpoint_name = <span class="hljs-string">"MY ENDPOINT NAME"</span> | |
| predictor = retrieve_default(endpoint_name) | |
| payload = { | |
| <span class="hljs-string">"messages"</span>: [ | |
| { | |
| <span class="hljs-string">"role"</span>: <span class="hljs-string">"system"</span>, | |
| <span class="hljs-string">"content"</span>: <span class="hljs-string">"You are a passionate data scientist."</span> | |
| }, | |
| { | |
| <span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, | |
| <span class="hljs-string">"content"</span>: <span class="hljs-string">"what is machine learning?"</span> | |
| } | |
| ], | |
| <span class="hljs-string">"max_tokens"</span>: <span class="hljs-number">2048</span>, | |
| <span class="hljs-string">"temperature"</span>: <span class="hljs-number">0.7</span>, | |
| <span class="hljs-string">"top_p"</span>: <span class="hljs-number">0.9</span>, | |
| <span class="hljs-string">"stream"</span>: <span class="hljs-literal">False</span> | |
| } | |
| response = predictor.predict(payload) | |
| <span class="hljs-built_in">print</span>(response)`,wrap:!1}}),E=new H({props:{title:"4. Clean‑up",local:"4-cleanup",headingTag:"h2"}}),_=new we({props:{code:"cHJlZGljdG9yLmRlbGV0ZV9tb2RlbCgpJTBBcHJlZGljdG9yLmRlbGV0ZV9lbmRwb2ludCgp",highlighted:`predictor.delete_model() | |
| predictor.delete_endpoint()`,wrap:!1}}),A=new Re({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/sagemaker/source/tutorials/jumpstart/jumpstart-quickstart.md"}}),{c(){c=i("meta"),R=s(),F=i("p"),X=s(),p(w.$$.fragment),L=s(),p(U.$$.fragment),Y=s(),p(J.$$.fragment),z=s(),C=i("p"),C.innerHTML=Je,P=s(),j=i("p"),j.innerHTML=Ce,D=s(),p(T.$$.fragment),K=s(),k=i("table"),k.innerHTML=je,O=s(),b=i("blockquote"),b.innerHTML=Te,ee=s(),p($.$$.fragment),te=s(),I=i("p"),I.textContent=ke,ae=s(),S=i("ol"),S.innerHTML=be,le=s(),g=i("img"),se=s(),v=i("p"),v.textContent=Ie,ne=s(),B=i("ol"),B.innerHTML=Se,ie=s(),h=i("img"),oe=s(),p(q.$$.fragment),re=s(),W=i("p"),W.textContent=Be,pe=s(),p(Q.$$.fragment),me=s(),N=i("p"),N.textContent=qe,ue=s(),p(G.$$.fragment),Me=s(),Z=i("p"),Z.textContent=We,ye=s(),p(E.$$.fragment),de=s(),x=i("p"),x.textContent=Qe,ce=s(),p(_.$$.fragment),ge=s(),p(A.$$.fragment),he=s(),V=i("p"),this.h()},l(e){const t=He("svelte-u9bgzb",document.head);c=o(t,"META",{name:!0,content:!0}),t.forEach(a),R=n(e),F=o(e,"P",{}),Ge(F).forEach(a),X=n(e),m(w.$$.fragment,e),L=n(e),m(U.$$.fragment,e),Y=n(e),m(J.$$.fragment,e),z=n(e),C=o(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-c323bq"&&(C.innerHTML=Je),P=n(e),j=o(e,"P",{"data-svelte-h":!0}),r(j)!=="svelte-glhkwk"&&(j.innerHTML=Ce),D=n(e),m(T.$$.fragment,e),K=n(e),k=o(e,"TABLE",{"data-svelte-h":!0}),r(k)!=="svelte-170vxk4"&&(k.innerHTML=je),O=n(e),b=o(e,"BLOCKQUOTE",{"data-svelte-h":!0}),r(b)!=="svelte-p7runb"&&(b.innerHTML=Te),ee=n(e),m($.$$.fragment,e),te=n(e),I=o(e,"P",{"data-svelte-h":!0}),r(I)!=="svelte-el0n8y"&&(I.textContent=ke),ae=n(e),S=o(e,"OL",{"data-svelte-h":!0}),r(S)!=="svelte-7ng80t"&&(S.innerHTML=be),le=n(e),g=o(e,"IMG",{src:!0,alt:!0,width:!0}),se=n(e),v=o(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1lzsyqk"&&(v.textContent=Ie),ne=n(e),B=o(e,"OL",{"data-svelte-h":!0}),r(B)!=="svelte-vh08fk"&&(B.innerHTML=Se),ie=n(e),h=o(e,"IMG",{src:!0,alt:!0,width:!0}),oe=n(e),m(q.$$.fragment,e),re=n(e),W=o(e,"P",{"data-svelte-h":!0}),r(W)!=="svelte-knhstf"&&(W.textContent=Be),pe=n(e),m(Q.$$.fragment,e),me=n(e),N=o(e,"P",{"data-svelte-h":!0}),r(N)!=="svelte-v65zqa"&&(N.textContent=qe),ue=n(e),m(G.$$.fragment,e),Me=n(e),Z=o(e,"P",{"data-svelte-h":!0}),r(Z)!=="svelte-r63eq3"&&(Z.textContent=We),ye=n(e),m(E.$$.fragment,e),de=n(e),x=o(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-t814jl"&&(x.textContent=Qe),ce=n(e),m(_.$$.fragment,e),ge=n(e),m(A.$$.fragment,e),he=n(e),V=o(e,"P",{}),Ge(V).forEach(a),this.h()},h(){f(c,"name","hf:doc:metadata"),f(c,"content",Le),Ne(g.src,$e="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/sagemaker/jumpstart-deployment.gif")||f(g,"src",$e),f(g,"alt","JumpStart deployment demo"),f(g,"width","500"),Ne(h.src,ve="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/sagemaker/hf-jumpstart-deployment.gif")||f(h,"src",ve),f(h,"alt","JumpStart deployment demo"),f(h,"width","500")},m(e,t){Fe(document.head,c),l(e,R,t),l(e,F,t),l(e,X,t),u(w,e,t),l(e,L,t),u(U,e,t),l(e,Y,t),u(J,e,t),l(e,z,t),l(e,C,t),l(e,P,t),l(e,j,t),l(e,D,t),u(T,e,t),l(e,K,t),l(e,k,t),l(e,O,t),l(e,b,t),l(e,ee,t),u($,e,t),l(e,te,t),l(e,I,t),l(e,ae,t),l(e,S,t),l(e,le,t),l(e,g,t),l(e,se,t),l(e,v,t),l(e,ne,t),l(e,B,t),l(e,ie,t),l(e,h,t),l(e,oe,t),u(q,e,t),l(e,re,t),l(e,W,t),l(e,pe,t),u(Q,e,t),l(e,me,t),l(e,N,t),l(e,ue,t),u(G,e,t),l(e,Me,t),l(e,Z,t),l(e,ye,t),u(E,e,t),l(e,de,t),l(e,x,t),l(e,ce,t),u(_,e,t),l(e,ge,t),u(A,e,t),l(e,he,t),l(e,V,t),fe=!0},p:Ee,i(e){fe||(M(w.$$.fragment,e),M(U.$$.fragment,e),M(J.$$.fragment,e),M(T.$$.fragment,e),M($.$$.fragment,e),M(q.$$.fragment,e),M(Q.$$.fragment,e),M(G.$$.fragment,e),M(E.$$.fragment,e),M(_.$$.fragment,e),M(A.$$.fragment,e),fe=!0)},o(e){y(w.$$.fragment,e),y(U.$$.fragment,e),y(J.$$.fragment,e),y(T.$$.fragment,e),y($.$$.fragment,e),y(q.$$.fragment,e),y(Q.$$.fragment,e),y(G.$$.fragment,e),y(E.$$.fragment,e),y(_.$$.fragment,e),y(A.$$.fragment,e),fe=!1},d(e){e&&(a(R),a(F),a(X),a(L),a(Y),a(z),a(C),a(P),a(j),a(D),a(K),a(k),a(O),a(b),a(ee),a(te),a(I),a(ae),a(S),a(le),a(g),a(se),a(v),a(ne),a(B),a(ie),a(h),a(oe),a(re),a(W),a(pe),a(me),a(N),a(ue),a(Me),a(Z),a(ye),a(de),a(x),a(ce),a(ge),a(he),a(V)),a(c),d(w,e),d(U,e),d(J,e),d(T,e),d($,e),d(q,e),d(Q,e),d(G,e),d(E,e),d(_,e),d(A,e)}}}const Le='{"title":"Quickstart - Deploy Hugging Face Models with SageMaker Jumpstart","local":"quickstart---deploy-hugging-face-models-with-sagemaker-jumpstart","sections":[{"title":"Why use SageMaker JumpStart for Hugging Face models?","local":"why-use-sagemaker-jumpstart-for-hugging-face-models","sections":[],"depth":2},{"title":"1. Prerequisites","local":"1-prerequisites","sections":[],"depth":2},{"title":"2· Endpoint deployment","local":"2-endpoint-deployment","sections":[],"depth":2},{"title":"3. Test interactively","local":"3-test-interactively","sections":[],"depth":2},{"title":"4. Clean‑up","local":"4-cleanup","sections":[],"depth":2}],"depth":1}';function Ye(Ue){return xe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oe extends _e{constructor(c){super(),Ae(this,c,Ye,Xe,Ze,{})}}export{Oe as component}; | |
Xet Storage Details
- Size:
- 15.5 kB
- Xet hash:
- 7623ed0c6c36d36558e14272b04a9b79d0ef2f7fba843a61f07bd3f8e215c5ff
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.