import{s as De,y as Ge,o as Ve,n as We}from"../chunks/scheduler.d6170356.js";import{S as Je,i as Oe,g as l,s as n,r as f,A as Xe,h as o,f as a,c as i,j as Ue,u as h,x as p,k as V,y as Ze,a as s,v as d,d as g,t as $,w as y,m as ze,n as Re}from"../chunks/index.fcd4cc08.js";import{T as Ke}from"../chunks/Tip.b09c67cf.js";import{C as Ye}from"../chunks/CodeBlock.7b16bdef.js";import{H as J,E as Qe}from"../chunks/EditOnGithub.da2b595c.js";function et(O){let m,c,v="them to Aim with one command",u;return{c(){m=ze("Note that if your logs are in TensorBoard format, you can easily convert "),c=l("a"),c.textContent=v,u=ze(" and use the many advanced and high-performant training run comparison features available."),this.h()},l(r){m=Re(r,"Note that if your logs are in TensorBoard format, you can easily convert "),c=o(r,"A",{href:!0,"data-svelte-h":!0}),p(c)!=="svelte-v6zsys"&&(c.textContent=v),u=Re(r," and use the many advanced and high-performant training run comparison features available."),this.h()},h(){V(c,"href","https://aimstack.readthedocs.io/en/latest/quick_start/convert_data.html#show-tensorboard-logs-in-aim")},m(r,b){s(r,m,b),s(r,c,b),s(r,u,b)},p:We,d(r){r&&(a(m),a(c),a(u))}}}function tt(O){let m,c,v,u,r,b,k,we=`<strong>Aim</strong> is an easy-to-use &amp; supercharged open-source experiment tracker. Aim logs your training runs and enables a beautiful UI to compare them and an API to query them programmatically.
ML engineers and researchers use Aim explorers to compare 1000s of training runs in a few clicks.`,X,T,_e=`Check out the <a href="https://aimstack.readthedocs.io/en/latest/" rel="nofollow">Aim docs</a> to learn more about Aim.
If you have an idea for a new feature or have noticed a bug, feel free to <a href="https://github.com/aimhubio/aim/issues/new/choose" rel="nofollow">open a feature request or report a bug</a>.`,Z,H,ke="In the following sections, you’ll learn how to deploy Aim on the Hugging Face Hub Spaces and explore your training runs directly from the Hub.",K,C,Q,A,Te="You can deploy Aim on Spaces with a single click!",ee,x,He='<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-to-spaces-lg.svg"/>',te,M,Ce="Once you have created the Space, you’ll see the <code>Building</code> status, and once it becomes <code>Running,</code> your Space is ready to go!",ae,w,Ae,se,L,Me="Now, when you navigate to your Space’s <strong>App</strong> section, you can access the Aim UI.",ne,S,ie,P,Le=`Let’s use a quick example of a PyTorch CNN trained on MNIST to demonstrate end-to-end Aim on Spaces deployment.
The full example is in the <a href="https://github.com/aimhubio/aim/blob/main/examples/pytorch_track.py" rel="nofollow">Aim repo examples folder</a>.`,le,j,oe,I,Se="The experiments tracked by Aim are stored in the <code>.aim</code> folder. <strong>To display the logs with the Aim UI in your Space, you need to compress the <code>.aim</code> folder to a <code>tar.gz</code> file and upload it to your Space using <code>git</code> or the Files and Versions sections of your Space.</strong>",re,F,Pe="Here’s a bash command for that:",pe,q,me,N,je=`That’s it! Now open the App section of your Space and the Aim UI is available with your logs.
Here is what to expect:`,ce,E,Ie='<img src="https://user-images.githubusercontent.com/23078323/232034340-0ba3ebbf-0374-4b14-ba80-1d36162fc994.png" alt="Aim UI on HF Hub Spaces"/>',ue,B,Fe='Filter your runs using Aim’s Pythonic search. You can write pythonic <a href="https://aimstack.readthedocs.io/en/latest/using/search.html" rel="nofollow">queries against</a> EVERYTHING you have tracked - metrics, hyperparams etc. Check out some <a href="https://huggingface.co/aimstack" rel="nofollow">examples</a> on HF Hub Spaces.',fe,_,he,U,de,z,qe='<li><a href="https://huggingface.co/docs/hub/spaces-sdks-docker" rel="nofollow">HF Docker spaces</a></li> <li><a href="https://huggingface.co/docs/hub/spaces-sdks-docker-examples" rel="nofollow">HF Docker space examples</a></li>',ge,R,$e,Y,Ne='If you have improvement suggestions or need support, please open an issue on <a href="https://github.com/aimhubio/aim" rel="nofollow">Aim GitHub repo</a>.',ye,D,Ee='The <a href="https://github.com/aimhubio/aim#-community" rel="nofollow">Aim community Discord</a> is also available for community discussions.',ve,G,be,W,xe;return r=new J({props:{title:"Aim on Spaces",local:"aim-on-spaces",headingTag:"h1"}}),C=new J({props:{title:"Deploy Aim on Spaces",local:"deploy-aim-on-spaces",headingTag:"h2"}}),S=new J({props:{title:"Compare your experiments with Aim on Spaces",local:"compare-your-experiments-with-aim-on-spaces",headingTag:"h2"}}),j=new Ye({props:{code:"JTBB",highlighted:`<span class="hljs-keyword">from</span> aim <span class="hljs-keyword">import</span> Run
<span class="hljs-keyword">from</span> aim.pytorch <span class="hljs-keyword">import</span> track_gradients_dists, track_params_dists

<span class="hljs-comment"># Initialize a new Run</span>
aim_run = Run()
...
items = {<span class="hljs-string">&#x27;accuracy&#x27;</span>: acc, <span class="hljs-string">&#x27;loss&#x27;</span>: loss}
aim_run.track(items, epoch=epoch, context={<span class="hljs-string">&#x27;subset&#x27;</span>: <span class="hljs-string">&#x27;train&#x27;</span>})

<span class="hljs-comment"># Track weights and gradients distributions</span>
track_params_dists(model, aim_run)
track_gradients_dists(model, aim_run)`,wrap:!1}}),q=new Ye({props:{code:"dGFyJTIwLWN6dmYlMjBhaW1fcmVwby50YXIuZ3olMjAuYWlt",highlighted:"tar -czvf aim_repo.tar.gz .aim",wrap:!1}}),_=new Ke({props:{$$slots:{default:[et]},$$scope:{ctx:O}}}),U=new J({props:{title:"More on HF Spaces",local:"more-on-hf-spaces",headingTag:"h2"}}),R=new J({props:{title:"Feedback and Support",local:"feedback-and-support",headingTag:"h2"}}),G=new Qe({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker-aim.md"}}),{c(){m=l("meta"),c=n(),v=l("p"),u=n(),f(r.$$.fragment),b=n(),k=l("p"),k.innerHTML=we,X=n(),T=l("p"),T.innerHTML=_e,Z=n(),H=l("p"),H.textContent=ke,K=n(),f(C.$$.fragment),Q=n(),A=l("p"),A.textContent=Te,ee=n(),x=l("a"),x.innerHTML=He,te=n(),M=l("p"),M.innerHTML=Ce,ae=n(),w=l("img"),se=n(),L=l("p"),L.innerHTML=Me,ne=n(),f(S.$$.fragment),ie=n(),P=l("p"),P.innerHTML=Le,le=n(),f(j.$$.fragment),oe=n(),I=l("p"),I.innerHTML=Se,re=n(),F=l("p"),F.textContent=Pe,pe=n(),f(q.$$.fragment),me=n(),N=l("p"),N.textContent=je,ce=n(),E=l("p"),E.innerHTML=Ie,ue=n(),B=l("p"),B.innerHTML=Fe,fe=n(),f(_.$$.fragment),he=n(),f(U.$$.fragment),de=n(),z=l("ul"),z.innerHTML=qe,ge=n(),f(R.$$.fragment),$e=n(),Y=l("p"),Y.innerHTML=Ne,ye=n(),D=l("p"),D.innerHTML=Ee,ve=n(),f(G.$$.fragment),be=n(),W=l("p"),this.h()},l(e){const t=Xe("svelte-u9bgzb",document.head);m=o(t,"META",{name:!0,content:!0}),t.forEach(a),c=i(e),v=o(e,"P",{}),Ue(v).forEach(a),u=i(e),h(r.$$.fragment,e),b=i(e),k=o(e,"P",{"data-svelte-h":!0}),p(k)!=="svelte-utn25p"&&(k.innerHTML=we),X=i(e),T=o(e,"P",{"data-svelte-h":!0}),p(T)!=="svelte-fxi6sx"&&(T.innerHTML=_e),Z=i(e),H=o(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-v9q6v"&&(H.textContent=ke),K=i(e),h(C.$$.fragment,e),Q=i(e),A=o(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-vk7oxf"&&(A.textContent=Te),ee=i(e),x=o(e,"A",{href:!0,"data-svelte-h":!0}),p(x)!=="svelte-1dtnia2"&&(x.innerHTML=He),te=i(e),M=o(e,"P",{"data-svelte-h":!0}),p(M)!=="svelte-17o1fcr"&&(M.innerHTML=Ce),ae=i(e),w=o(e,"IMG",{src:!0,alt:!0,width:!0}),se=i(e),L=o(e,"P",{"data-svelte-h":!0}),p(L)!=="svelte-s6uvdm"&&(L.innerHTML=Me),ne=i(e),h(S.$$.fragment,e),ie=i(e),P=o(e,"P",{"data-svelte-h":!0}),p(P)!=="svelte-ikegc5"&&(P.innerHTML=Le),le=i(e),h(j.$$.fragment,e),oe=i(e),I=o(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-og10ld"&&(I.innerHTML=Se),re=i(e),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-lhppeq"&&(F.textContent=Pe),pe=i(e),h(q.$$.fragment,e),me=i(e),N=o(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-1tj3ty"&&(N.textContent=je),ce=i(e),E=o(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-11kiwl9"&&(E.innerHTML=Ie),ue=i(e),B=o(e,"P",{"data-svelte-h":!0}),p(B)!=="svelte-1gnl7np"&&(B.innerHTML=Fe),fe=i(e),h(_.$$.fragment,e),he=i(e),h(U.$$.fragment,e),de=i(e),z=o(e,"UL",{"data-svelte-h":!0}),p(z)!=="svelte-1bbheqk"&&(z.innerHTML=qe),ge=i(e),h(R.$$.fragment,e),$e=i(e),Y=o(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-ikdt0r"&&(Y.innerHTML=Ne),ye=i(e),D=o(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-1mpjbi8"&&(D.innerHTML=Ee),ve=i(e),h(G.$$.fragment,e),be=i(e),W=o(e,"P",{}),Ue(W).forEach(a),this.h()},h(){V(m,"name","hf:doc:metadata"),V(m,"content",at),V(x,"href","https://huggingface.co/new-space?template=aimstack/aim"),Ge(w.src,Ae="https://user-images.githubusercontent.com/23078323/231592155-869148a0-9a92-475f-8ebe-34d4deb2abc2.png")||V(w,"src",Ae),V(w,"alt","Creating an Aim Space"),V(w,"width","800")},m(e,t){Ze(document.head,m),s(e,c,t),s(e,v,t),s(e,u,t),d(r,e,t),s(e,b,t),s(e,k,t),s(e,X,t),s(e,T,t),s(e,Z,t),s(e,H,t),s(e,K,t),d(C,e,t),s(e,Q,t),s(e,A,t),s(e,ee,t),s(e,x,t),s(e,te,t),s(e,M,t),s(e,ae,t),s(e,w,t),s(e,se,t),s(e,L,t),s(e,ne,t),d(S,e,t),s(e,ie,t),s(e,P,t),s(e,le,t),d(j,e,t),s(e,oe,t),s(e,I,t),s(e,re,t),s(e,F,t),s(e,pe,t),d(q,e,t),s(e,me,t),s(e,N,t),s(e,ce,t),s(e,E,t),s(e,ue,t),s(e,B,t),s(e,fe,t),d(_,e,t),s(e,he,t),d(U,e,t),s(e,de,t),s(e,z,t),s(e,ge,t),d(R,e,t),s(e,$e,t),s(e,Y,t),s(e,ye,t),s(e,D,t),s(e,ve,t),d(G,e,t),s(e,be,t),s(e,W,t),xe=!0},p(e,[t]){const Be={};t&2&&(Be.$$scope={dirty:t,ctx:e}),_.$set(Be)},i(e){xe||(g(r.$$.fragment,e),g(C.$$.fragment,e),g(S.$$.fragment,e),g(j.$$.fragment,e),g(q.$$.fragment,e),g(_.$$.fragment,e),g(U.$$.fragment,e),g(R.$$.fragment,e),g(G.$$.fragment,e),xe=!0)},o(e){$(r.$$.fragment,e),$(C.$$.fragment,e),$(S.$$.fragment,e),$(j.$$.fragment,e),$(q.$$.fragment,e),$(_.$$.fragment,e),$(U.$$.fragment,e),$(R.$$.fragment,e),$(G.$$.fragment,e),xe=!1},d(e){e&&(a(c),a(v),a(u),a(b),a(k),a(X),a(T),a(Z),a(H),a(K),a(Q),a(A),a(ee),a(x),a(te),a(M),a(ae),a(w),a(se),a(L),a(ne),a(ie),a(P),a(le),a(oe),a(I),a(re),a(F),a(pe),a(me),a(N),a(ce),a(E),a(ue),a(B),a(fe),a(he),a(de),a(z),a(ge),a($e),a(Y),a(ye),a(D),a(ve),a(be),a(W)),a(m),y(r,e),y(C,e),y(S,e),y(j,e),y(q,e),y(_,e),y(U,e),y(R,e),y(G,e)}}}const at='{"title":"Aim on Spaces","local":"aim-on-spaces","sections":[{"title":"Deploy Aim on Spaces","local":"deploy-aim-on-spaces","sections":[],"depth":2},{"title":"Compare your experiments with Aim on Spaces","local":"compare-your-experiments-with-aim-on-spaces","sections":[],"depth":2},{"title":"More on HF Spaces","local":"more-on-hf-spaces","sections":[],"depth":2},{"title":"Feedback and Support","local":"feedback-and-support","sections":[],"depth":2}],"depth":1}';function st(O){return Ve(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pt extends Je{constructor(m){super(),Oe(this,m,st,tt,De,{})}}export{pt as component};
