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