import{s as K,n as L,o as Q}from"../chunks/scheduler.b9285784.js";import{S as F,i as V,e as f,s,c as E,h as W,a as h,d as l,b as n,f as Y,g as H,j as B,k as S,l as N,m as a,n as z,t as T,o as X,p as R}from"../chunks/index.26bc89a1.js";import{C as D,H as q,E as O}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.7242ff19.js";import{C as ee}from"../chunks/CodeBlock.c8ee1711.js";function te(G){let i,j,w,$,m,g,p,C,M,Z=`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!`,b,c,I="Most code examples start from the following python code before integrating Accelerate in some way:",_,d,v,o,J='<iframe src="https://hf-accelerate-accelerate-examples.hf.space?__theme=light" width="850" height="1600"></iframe>',x,r,P='<iframe src="https://hf-accelerate-accelerate-examples.hf.space?__theme=dark" width="850" height="1600"></iframe>',U,u,A,y,k;return m=new D({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),p=new q({props:{title:"Start Here!",local:"start-here",headingTag:"h1"}}),d=new ee({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}}),u=new O({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/usage_guides/explore.md"}}),{c(){i=f("meta"),j=s(),w=f("p"),$=s(),E(m.$$.fragment),g=s(),E(p.$$.fragment),C=s(),M=f("p"),M.textContent=Z,b=s(),c=f("p"),c.textContent=I,_=s(),E(d.$$.fragment),v=s(),o=f("div"),o.innerHTML=J,x=s(),r=f("div"),r.innerHTML=P,U=s(),E(u.$$.fragment),A=s(),y=f("p"),this.h()},l(e){const t=W("svelte-u9bgzb",document.head);i=h(t,"META",{name:!0,content:!0}),t.forEach(l),j=n(e),w=h(e,"P",{}),Y(w).forEach(l),$=n(e),H(m.$$.fragment,e),g=n(e),H(p.$$.fragment,e),C=n(e),M=h(e,"P",{"data-svelte-h":!0}),B(M)!=="svelte-em28ry"&&(M.textContent=Z),b=n(e),c=h(e,"P",{"data-svelte-h":!0}),B(c)!=="svelte-j5o0cu"&&(c.textContent=I),_=n(e),H(d.$$.fragment,e),v=n(e),o=h(e,"DIV",{class:!0,"data-svelte-h":!0}),B(o)!=="svelte-o1cyu6"&&(o.innerHTML=J),x=n(e),r=h(e,"DIV",{class:!0,"data-svelte-h":!0}),B(r)!=="svelte-f0yl8l"&&(r.innerHTML=P),U=n(e),H(u.$$.fragment,e),A=n(e),y=h(e,"P",{}),Y(y).forEach(l),this.h()},h(){S(i,"name","hf:doc:metadata"),S(i,"content",le),S(o,"class","block dark:hidden"),S(r,"class","hidden dark:block")},m(e,t){N(document.head,i),a(e,j,t),a(e,w,t),a(e,$,t),z(m,e,t),a(e,g,t),z(p,e,t),a(e,C,t),a(e,M,t),a(e,b,t),a(e,c,t),a(e,_,t),z(d,e,t),a(e,v,t),a(e,o,t),a(e,x,t),a(e,r,t),a(e,U,t),z(u,e,t),a(e,A,t),a(e,y,t),k=!0},p:L,i(e){k||(T(m.$$.fragment,e),T(p.$$.fragment,e),T(d.$$.fragment,e),T(u.$$.fragment,e),k=!0)},o(e){X(m.$$.fragment,e),X(p.$$.fragment,e),X(d.$$.fragment,e),X(u.$$.fragment,e),k=!1},d(e){e&&(l(j),l(w),l($),l(g),l(C),l(M),l(b),l(c),l(_),l(v),l(o),l(x),l(r),l(U),l(A),l(y)),l(i),R(m,e),R(p,e),R(d,e),R(u,e)}}}const le='{"title":"Start Here!","local":"start-here","sections":[],"depth":1}';function ae(G){return Q(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class re extends F{constructor(i){super(),V(this,i,ae,te,K,{})}}export{re as component};
