import{s as Re,y as Ye,o as De,n as Ge}from"../chunks/scheduler.d6170356.js";import{S as Ve,i as We,g as l,s as n,r as y,A as Je,h as o,f as a,c as i,j as Be,u as v,x as p,k as G,y as Oe,a as s,v as x,d as _,t as b,w,m as Ue,n as ze}from"../chunks/index.fcd4cc08.js";import{T as Xe}from"../chunks/Tip.b09c67cf.js";import{C as Ee}from"../chunks/CodeBlock.7b16bdef.js";import{H as W}from"../chunks/Heading.8660bd0e.js";function Ze(J){let m,c,f="them to Aim with one command",u;return{c(){m=Ue("Note that if your logs are in TensorBoard format, you can easily convert "),c=l("a"),c.textContent=f,u=Ue(" and use the many advanced and high-performant training run comparison features available."),this.h()},l(r){m=ze(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=f),u=ze(r," and use the many advanced and high-performant training run comparison features available."),this.h()},h(){G(c,"href","https://aimstack.readthedocs.io/en/latest/quick_start/convert_data.html#show-tensorboard-logs-in-aim")},m(r,h){s(r,m,h),s(r,c,h),s(r,u,h)},p:Ge,d(r){r&&(a(m),a(c),a(u))}}}function Ke(J){let m,c,f,u,r,h,T,xe=`<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.`,O,k,_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>.`,X,H,be="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.",Z,C,K,A,we="You can deploy Aim on Spaces with a single click!",Q,d,Te='<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-to-spaces-lg.svg"/>',ee,M,ke="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!",te,g,He,ae,L,Ce="Now, when you navigate to your Space’s <strong>App</strong> section, you can access the Aim UI.",se,S,ne,P,Ae=`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>.`,ie,j,le,I,Me="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>",oe,F,Le="Here’s a bash command for that:",re,q,pe,N,Se=`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:`,me,B,Pe='<img src="https://user-images.githubusercontent.com/23078323/232034340-0ba3ebbf-0374-4b14-ba80-1d36162fc994.png" alt="Aim UI on HF Hub Spaces"/>',ce,U,je='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.',ue,$,fe,z,he,E,Ie='<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>',de,R,ge,Y,Fe='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>.',$e,D,qe='The <a href="https://github.com/aimhubio/aim#-community" rel="nofollow">Aim community Discord</a> is also available for community discussions.',ye,V,ve;return r=new W({props:{title:"Aim on Spaces",local:"aim-on-spaces",headingTag:"h1"}}),C=new W({props:{title:"Deploy Aim on Spaces",local:"deploy-aim-on-spaces",headingTag:"h2"}}),S=new W({props:{title:"Compare your experiments with Aim on Spaces",local:"compare-your-experiments-with-aim-on-spaces",headingTag:"h2"}}),j=new Ee({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 Ee({props:{code:"dGFyJTIwLWN6dmYlMjBhaW1fcmVwby50YXIuZ3olMjAuYWlt",highlighted:"tar -czvf aim_repo.tar.gz .aim",wrap:!1}}),$=new Xe({props:{$$slots:{default:[Ze]},$$scope:{ctx:J}}}),z=new W({props:{title:"More on HF Spaces",local:"more-on-hf-spaces",headingTag:"h2"}}),R=new W({props:{title:"Feedback and Support",local:"feedback-and-support",headingTag:"h2"}}),{c(){m=l("meta"),c=n(),f=l("p"),u=n(),y(r.$$.fragment),h=n(),T=l("p"),T.innerHTML=xe,O=n(),k=l("p"),k.innerHTML=_e,X=n(),H=l("p"),H.textContent=be,Z=n(),y(C.$$.fragment),K=n(),A=l("p"),A.textContent=we,Q=n(),d=l("a"),d.innerHTML=Te,ee=n(),M=l("p"),M.innerHTML=ke,te=n(),g=l("img"),ae=n(),L=l("p"),L.innerHTML=Ce,se=n(),y(S.$$.fragment),ne=n(),P=l("p"),P.innerHTML=Ae,ie=n(),y(j.$$.fragment),le=n(),I=l("p"),I.innerHTML=Me,oe=n(),F=l("p"),F.textContent=Le,re=n(),y(q.$$.fragment),pe=n(),N=l("p"),N.textContent=Se,me=n(),B=l("p"),B.innerHTML=Pe,ce=n(),U=l("p"),U.innerHTML=je,ue=n(),y($.$$.fragment),fe=n(),y(z.$$.fragment),he=n(),E=l("ul"),E.innerHTML=Ie,de=n(),y(R.$$.fragment),ge=n(),Y=l("p"),Y.innerHTML=Fe,$e=n(),D=l("p"),D.innerHTML=qe,ye=n(),V=l("p"),this.h()},l(e){const t=Je("svelte-u9bgzb",document.head);m=o(t,"META",{name:!0,content:!0}),t.forEach(a),c=i(e),f=o(e,"P",{}),Be(f).forEach(a),u=i(e),v(r.$$.fragment,e),h=i(e),T=o(e,"P",{"data-svelte-h":!0}),p(T)!=="svelte-utn25p"&&(T.innerHTML=xe),O=i(e),k=o(e,"P",{"data-svelte-h":!0}),p(k)!=="svelte-fxi6sx"&&(k.innerHTML=_e),X=i(e),H=o(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-v9q6v"&&(H.textContent=be),Z=i(e),v(C.$$.fragment,e),K=i(e),A=o(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-vk7oxf"&&(A.textContent=we),Q=i(e),d=o(e,"A",{href:!0,"data-svelte-h":!0}),p(d)!=="svelte-1dtnia2"&&(d.innerHTML=Te),ee=i(e),M=o(e,"P",{"data-svelte-h":!0}),p(M)!=="svelte-17o1fcr"&&(M.innerHTML=ke),te=i(e),g=o(e,"IMG",{src:!0,alt:!0,width:!0}),ae=i(e),L=o(e,"P",{"data-svelte-h":!0}),p(L)!=="svelte-s6uvdm"&&(L.innerHTML=Ce),se=i(e),v(S.$$.fragment,e),ne=i(e),P=o(e,"P",{"data-svelte-h":!0}),p(P)!=="svelte-ikegc5"&&(P.innerHTML=Ae),ie=i(e),v(j.$$.fragment,e),le=i(e),I=o(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-og10ld"&&(I.innerHTML=Me),oe=i(e),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-lhppeq"&&(F.textContent=Le),re=i(e),v(q.$$.fragment,e),pe=i(e),N=o(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-1tj3ty"&&(N.textContent=Se),me=i(e),B=o(e,"P",{"data-svelte-h":!0}),p(B)!=="svelte-11kiwl9"&&(B.innerHTML=Pe),ce=i(e),U=o(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-1gnl7np"&&(U.innerHTML=je),ue=i(e),v($.$$.fragment,e),fe=i(e),v(z.$$.fragment,e),he=i(e),E=o(e,"UL",{"data-svelte-h":!0}),p(E)!=="svelte-1bbheqk"&&(E.innerHTML=Ie),de=i(e),v(R.$$.fragment,e),ge=i(e),Y=o(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-ikdt0r"&&(Y.innerHTML=Fe),$e=i(e),D=o(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-1mpjbi8"&&(D.innerHTML=qe),ye=i(e),V=o(e,"P",{}),Be(V).forEach(a),this.h()},h(){G(m,"name","hf:doc:metadata"),G(m,"content",Qe),G(d,"href","https://huggingface.co/new-space?template=aimstack/aim"),Ye(g.src,He="https://user-images.githubusercontent.com/23078323/231592155-869148a0-9a92-475f-8ebe-34d4deb2abc2.png")||G(g,"src",He),G(g,"alt","Creating an Aim Space"),G(g,"width","800")},m(e,t){Oe(document.head,m),s(e,c,t),s(e,f,t),s(e,u,t),x(r,e,t),s(e,h,t),s(e,T,t),s(e,O,t),s(e,k,t),s(e,X,t),s(e,H,t),s(e,Z,t),x(C,e,t),s(e,K,t),s(e,A,t),s(e,Q,t),s(e,d,t),s(e,ee,t),s(e,M,t),s(e,te,t),s(e,g,t),s(e,ae,t),s(e,L,t),s(e,se,t),x(S,e,t),s(e,ne,t),s(e,P,t),s(e,ie,t),x(j,e,t),s(e,le,t),s(e,I,t),s(e,oe,t),s(e,F,t),s(e,re,t),x(q,e,t),s(e,pe,t),s(e,N,t),s(e,me,t),s(e,B,t),s(e,ce,t),s(e,U,t),s(e,ue,t),x($,e,t),s(e,fe,t),x(z,e,t),s(e,he,t),s(e,E,t),s(e,de,t),x(R,e,t),s(e,ge,t),s(e,Y,t),s(e,$e,t),s(e,D,t),s(e,ye,t),s(e,V,t),ve=!0},p(e,[t]){const Ne={};t&2&&(Ne.$$scope={dirty:t,ctx:e}),$.$set(Ne)},i(e){ve||(_(r.$$.fragment,e),_(C.$$.fragment,e),_(S.$$.fragment,e),_(j.$$.fragment,e),_(q.$$.fragment,e),_($.$$.fragment,e),_(z.$$.fragment,e),_(R.$$.fragment,e),ve=!0)},o(e){b(r.$$.fragment,e),b(C.$$.fragment,e),b(S.$$.fragment,e),b(j.$$.fragment,e),b(q.$$.fragment,e),b($.$$.fragment,e),b(z.$$.fragment,e),b(R.$$.fragment,e),ve=!1},d(e){e&&(a(c),a(f),a(u),a(h),a(T),a(O),a(k),a(X),a(H),a(Z),a(K),a(A),a(Q),a(d),a(ee),a(M),a(te),a(g),a(ae),a(L),a(se),a(ne),a(P),a(ie),a(le),a(I),a(oe),a(F),a(re),a(pe),a(N),a(me),a(B),a(ce),a(U),a(ue),a(fe),a(he),a(E),a(de),a(ge),a(Y),a($e),a(D),a(ye),a(V)),a(m),w(r,e),w(C,e),w(S,e),w(j,e),w(q,e),w($,e),w(z,e),w(R,e)}}}const Qe='{"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 et(J){return De(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class lt extends Ve{constructor(m){super(),We(this,m,et,Ke,Re,{})}}export{lt as component};
