import{s as P,n as Y,o as K}from"../chunks/scheduler.defa9a21.js";import{S as Q,i as F,g as u,s as n,r as E,A as L,h,f as l,c as i,j as J,u as H,x as k,k as x,y as V,a,v as B,d as S,t as X,w as z}from"../chunks/index.fe795e71.js";import{C as W}from"../chunks/CodeBlock.204b6c34.js";import{H as N,E as D}from"../chunks/getInferenceSnippets.2234a8dd.js";function q(R){let s,j,f,y,c,g,m,T=`Please use the interactive tool below to help you get started with learning about a particular
feature of Accelerate and how to utilize it! It will provide you with a code diff, an explanation
towards what is going on, as well as provide you with some useful links to explore more within
the documentation!`,_,M,G="Most code examples start from the following python code before integrating Accelerate in some way:",b,p,v,o,Z='<iframe src="https://hf-accelerate-accelerate-examples.hf.space?__theme=light" width="850" height="1600"></iframe>',C,r,I='<iframe src="https://hf-accelerate-accelerate-examples.hf.space?__theme=dark" width="850" height="1600"></iframe>',$,d,A,w,U;return c=new N({props:{title:"Start Here!",local:"start-here",headingTag:"h1"}}),p=new W({props:{code:"Zm9yJTIwYmF0Y2glMjBpbiUyMGRhdGFsb2FkZXIlM0ElMEElMjAlMjAlMjAlMjBvcHRpbWl6ZXIuemVyb19ncmFkKCklMEElMjAlMjAlMjAlMjBpbnB1dHMlMkMlMjB0YXJnZXRzJTIwJTNEJTIwYmF0Y2glMEElMjAlMjAlMjAlMjBpbnB1dHMlMjAlM0QlMjBpbnB1dHMudG8oZGV2aWNlKSUwQSUyMCUyMCUyMCUyMHRhcmdldHMlMjAlM0QlMjB0YXJnZXRzLnRvKGRldmljZSklMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRzKSUwQSUyMCUyMCUyMCUyMGxvc3MlMjAlM0QlMjBsb3NzX2Z1bmN0aW9uKG91dHB1dHMlMkMlMjB0YXJnZXRzKSUwQSUyMCUyMCUyMCUyMGxvc3MuYmFja3dhcmQoKSUwQSUyMCUyMCUyMCUyMG9wdGltaXplci5zdGVwKCklMEElMjAlMjAlMjAlMjBzY2hlZHVsZXIuc3RlcCgp",highlighted:`<span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> dataloader:
    optimizer.zero_grad()
    inputs, targets = batch
    inputs = inputs.to(device)
    targets = targets.to(device)
    outputs = model(inputs)
    loss = loss_function(outputs, targets)
    loss.backward()
    optimizer.step()
    scheduler.step()`,wrap:!1}}),d=new D({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/usage_guides/explore.md"}}),{c(){s=u("meta"),j=n(),f=u("p"),y=n(),E(c.$$.fragment),g=n(),m=u("p"),m.textContent=T,_=n(),M=u("p"),M.textContent=G,b=n(),E(p.$$.fragment),v=n(),o=u("div"),o.innerHTML=Z,C=n(),r=u("div"),r.innerHTML=I,$=n(),E(d.$$.fragment),A=n(),w=u("p"),this.h()},l(e){const t=L("svelte-u9bgzb",document.head);s=h(t,"META",{name:!0,content:!0}),t.forEach(l),j=i(e),f=h(e,"P",{}),J(f).forEach(l),y=i(e),H(c.$$.fragment,e),g=i(e),m=h(e,"P",{"data-svelte-h":!0}),k(m)!=="svelte-em28ry"&&(m.textContent=T),_=i(e),M=h(e,"P",{"data-svelte-h":!0}),k(M)!=="svelte-j5o0cu"&&(M.textContent=G),b=i(e),H(p.$$.fragment,e),v=i(e),o=h(e,"DIV",{class:!0,"data-svelte-h":!0}),k(o)!=="svelte-o1cyu6"&&(o.innerHTML=Z),C=i(e),r=h(e,"DIV",{class:!0,"data-svelte-h":!0}),k(r)!=="svelte-f0yl8l"&&(r.innerHTML=I),$=i(e),H(d.$$.fragment,e),A=i(e),w=h(e,"P",{}),J(w).forEach(l),this.h()},h(){x(s,"name","hf:doc:metadata"),x(s,"content",O),x(o,"class","block dark:hidden"),x(r,"class","hidden dark:block")},m(e,t){V(document.head,s),a(e,j,t),a(e,f,t),a(e,y,t),B(c,e,t),a(e,g,t),a(e,m,t),a(e,_,t),a(e,M,t),a(e,b,t),B(p,e,t),a(e,v,t),a(e,o,t),a(e,C,t),a(e,r,t),a(e,$,t),B(d,e,t),a(e,A,t),a(e,w,t),U=!0},p:Y,i(e){U||(S(c.$$.fragment,e),S(p.$$.fragment,e),S(d.$$.fragment,e),U=!0)},o(e){X(c.$$.fragment,e),X(p.$$.fragment,e),X(d.$$.fragment,e),U=!1},d(e){e&&(l(j),l(f),l(y),l(g),l(m),l(_),l(M),l(b),l(v),l(o),l(C),l(r),l($),l(A),l(w)),l(s),z(c,e),z(p,e),z(d,e)}}}const O='{"title":"Start Here!","local":"start-here","sections":[],"depth":1}';function ee(R){return K(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ne extends Q{constructor(s){super(),F(this,s,ee,q,P,{})}}export{ne as component};
