import{s as xt,o as kt,n as Jt}from"../chunks/scheduler.37c15a92.js";import{S as Ut,i as It,g as r,s as a,r as g,A as St,h as p,f as n,c as i,j as Ct,u as f,x as u,k as vt,y as At,a as l,v as m,d as h,t as y,w as $}from"../chunks/index.2bf4358c.js";import{T as bt}from"../chunks/Tip.363c041f.js";import{C as _t}from"../chunks/CodeBlock.4f5fc1ad.js";import{C as Pt}from"../chunks/CourseFloatingBanner.15ba07e6.js";import{H as rt,E as Ht}from"../chunks/EditOnGithub.8916dc7c.js";function Lt(q){let s,c=`⚠️ You may want to enable <strong>Persistent storage</strong> so the data isn’t lost if the Space is paused or restarted.
You can do that from the Settings of your Space.`;return{c(){s=r("p"),s.innerHTML=c},l(o){s=p(o,"P",{"data-svelte-h":!0}),u(s)!=="svelte-r4sefo"&&(s.innerHTML=c)},m(o,d){l(o,s,d)},p:Jt,d(o){o&&n(s)}}}function jt(q){let s,c='💡 Alternatively, you may want to deploy Argilla locally instead of using a Hugging Face Space. You can do this using a Docker image as explained in <a href="https://docs.argilla.io/dev/getting_started/how-to-deploy-argilla-with-docker/" rel="nofollow">this guide</a>.';return{c(){s=r("p"),s.innerHTML=c},l(o){s=p(o,"P",{"data-svelte-h":!0}),u(s)!=="svelte-dfq0f6"&&(s.innerHTML=c)},m(o,d){l(o,s,d)},p:Jt,d(o){o&&n(s)}}}function Et(q){let s,c,o,d,M,F,C,z,v,pt="To start using Argilla, you will need to set up your own Argilla instance first. Then you will need to install the Python SDK so that you can manage Argilla using Python code.",D,b,G,_,ut="The easiest way to set up your Argilla instance is through Hugging Face Spaces:",R,J,ct='<li>Go to <a href="https://huggingface.co/spaces" rel="nofollow">Spaces</a> in the Hugging Face Hub, and then click <strong>Create new Space</strong>.</li> <li>Under “Select the Space SDK” select <strong>Docker</strong>, then <strong>Argilla</strong>.</li> <li>Fill in the rest of the form following the instructions and click <strong>Create Space</strong>.</li>',X,w,N,T,W,x,gt="Once Argilla is up and running, you can log in with your credentials.",K,k,O,U,ft="Now you can go to your Python environment or notebook and install the argilla library:",Z,I,mt="<code>!pip install argilla</code>",Q,S,ht="Let’s connect with our Argilla instance. To do that you will need the following information:",V,A,yt="<li><strong>Your API URL</strong>: This is the URL where Argilla is running. If you are using a Space, you can open the Space, click on the three dots in the top right corner, then “Embed this Space” and copy the <strong>Direct URL</strong>. It should look something like <code>https://&lt;your-username&gt;.&lt;space-name&gt;.hf.space</code>.</li> <li><strong>Your API key</strong>: To get your key, log in to your Argilla instance and go to “My Settings”, then copy the API key.</li> <li><strong>Your HF token</strong>: If your Space is private, you will need to an Access Token in your Hugging Face Hub account with writing permissions.</li>",tt,P,et,H,$t="To check that everything is working properly, we’ll call <code>me</code>. This should return our user:",nt,L,lt,j,dt="If this worked, your Argilla instance is up and running and you’re connected to it! Congrats!",st,E,wt="We can now get started with loading our first dataset to Argilla.",at,B,it,Y,ot;return M=new rt({props:{title:"Set up your Argilla instance",local:"set-up-your-argilla-instance",headingTag:"h1"}}),C=new Pt({props:{chapter:10,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter10/section2.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter10/section2.ipynb"}]}}),b=new rt({props:{title:"Deploy the Argilla UI",local:"deploy-the-argilla-ui",headingTag:"h2"}}),w=new bt({props:{warning:!0,$$slots:{default:[Lt]},$$scope:{ctx:q}}}),T=new bt({props:{warning:!1,$$slots:{default:[jt]},$$scope:{ctx:q}}}),k=new rt({props:{title:"Install and connect the Python SDK",local:"install-and-connect-the-python-sdk",headingTag:"h2"}}),P=new _t({props:{code:"aW1wb3J0JTIwYXJnaWxsYSUyMGFzJTIwcmclMEElMEFIRl9UT0tFTiUyMCUzRCUyMCUyMi4uLiUyMiUyMCUyMCUyMyUyMG9ubHklMjBmb3IlMjBwcml2YXRlJTIwc3BhY2VzJTBBJTBBY2xpZW50JTIwJTNEJTIwcmcuQXJnaWxsYSglMEElMjAlMjAlMjAlMjBhcGlfdXJsJTNEJTIyLi4uJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRCUyMi4uLiUyMiUyQyUwQSUyMCUyMCUyMCUyMGhlYWRlcnMlM0QlN0IlMjJBdXRob3JpemF0aW9uJTIyJTNBJTIwZiUyMkJlYXJlciUyMCU3QkhGX1RPS0VOJTdEJTIyJTdEJTJDJTIwJTIwJTIzJTIwb25seSUyMGZvciUyMHByaXZhdGUlMjBzcGFjZXMlMEEp",highlighted:`<span class="hljs-keyword">import</span> argilla <span class="hljs-keyword">as</span> rg

HF_TOKEN = <span class="hljs-string">&quot;...&quot;</span>  <span class="hljs-comment"># only for private spaces</span>

client = rg.Argilla(
    api_url=<span class="hljs-string">&quot;...&quot;</span>,
    api_key=<span class="hljs-string">&quot;...&quot;</span>,
    headers={<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{HF_TOKEN}</span>&quot;</span>},  <span class="hljs-comment"># only for private spaces</span>
)`,wrap:!1}}),L=new _t({props:{code:"Y2xpZW50Lm1l",highlighted:"client.me",wrap:!1}}),B=new Ht({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter10/2.mdx"}}),{c(){s=r("meta"),c=a(),o=r("p"),d=a(),g(M.$$.fragment),F=a(),g(C.$$.fragment),z=a(),v=r("p"),v.textContent=pt,D=a(),g(b.$$.fragment),G=a(),_=r("p"),_.textContent=ut,R=a(),J=r("ol"),J.innerHTML=ct,X=a(),g(w.$$.fragment),N=a(),g(T.$$.fragment),W=a(),x=r("p"),x.textContent=gt,K=a(),g(k.$$.fragment),O=a(),U=r("p"),U.textContent=ft,Z=a(),I=r("p"),I.innerHTML=mt,Q=a(),S=r("p"),S.textContent=ht,V=a(),A=r("ul"),A.innerHTML=yt,tt=a(),g(P.$$.fragment),et=a(),H=r("p"),H.innerHTML=$t,nt=a(),g(L.$$.fragment),lt=a(),j=r("p"),j.textContent=dt,st=a(),E=r("p"),E.textContent=wt,at=a(),g(B.$$.fragment),it=a(),Y=r("p"),this.h()},l(t){const e=St("svelte-u9bgzb",document.head);s=p(e,"META",{name:!0,content:!0}),e.forEach(n),c=i(t),o=p(t,"P",{}),Ct(o).forEach(n),d=i(t),f(M.$$.fragment,t),F=i(t),f(C.$$.fragment,t),z=i(t),v=p(t,"P",{"data-svelte-h":!0}),u(v)!=="svelte-q065f"&&(v.textContent=pt),D=i(t),f(b.$$.fragment,t),G=i(t),_=p(t,"P",{"data-svelte-h":!0}),u(_)!=="svelte-u4l16g"&&(_.textContent=ut),R=i(t),J=p(t,"OL",{"data-svelte-h":!0}),u(J)!=="svelte-qqv5ww"&&(J.innerHTML=ct),X=i(t),f(w.$$.fragment,t),N=i(t),f(T.$$.fragment,t),W=i(t),x=p(t,"P",{"data-svelte-h":!0}),u(x)!=="svelte-zgnnl3"&&(x.textContent=gt),K=i(t),f(k.$$.fragment,t),O=i(t),U=p(t,"P",{"data-svelte-h":!0}),u(U)!=="svelte-1ylnx4"&&(U.textContent=ft),Z=i(t),I=p(t,"P",{"data-svelte-h":!0}),u(I)!=="svelte-7zjbtm"&&(I.innerHTML=mt),Q=i(t),S=p(t,"P",{"data-svelte-h":!0}),u(S)!=="svelte-v96que"&&(S.textContent=ht),V=i(t),A=p(t,"UL",{"data-svelte-h":!0}),u(A)!=="svelte-1ok4akm"&&(A.innerHTML=yt),tt=i(t),f(P.$$.fragment,t),et=i(t),H=p(t,"P",{"data-svelte-h":!0}),u(H)!=="svelte-fber77"&&(H.innerHTML=$t),nt=i(t),f(L.$$.fragment,t),lt=i(t),j=p(t,"P",{"data-svelte-h":!0}),u(j)!=="svelte-el50rm"&&(j.textContent=dt),st=i(t),E=p(t,"P",{"data-svelte-h":!0}),u(E)!=="svelte-q3cjsu"&&(E.textContent=wt),at=i(t),f(B.$$.fragment,t),it=i(t),Y=p(t,"P",{}),Ct(Y).forEach(n),this.h()},h(){vt(s,"name","hf:doc:metadata"),vt(s,"content",Bt)},m(t,e){At(document.head,s),l(t,c,e),l(t,o,e),l(t,d,e),m(M,t,e),l(t,F,e),m(C,t,e),l(t,z,e),l(t,v,e),l(t,D,e),m(b,t,e),l(t,G,e),l(t,_,e),l(t,R,e),l(t,J,e),l(t,X,e),m(w,t,e),l(t,N,e),m(T,t,e),l(t,W,e),l(t,x,e),l(t,K,e),m(k,t,e),l(t,O,e),l(t,U,e),l(t,Z,e),l(t,I,e),l(t,Q,e),l(t,S,e),l(t,V,e),l(t,A,e),l(t,tt,e),m(P,t,e),l(t,et,e),l(t,H,e),l(t,nt,e),m(L,t,e),l(t,lt,e),l(t,j,e),l(t,st,e),l(t,E,e),l(t,at,e),m(B,t,e),l(t,it,e),l(t,Y,e),ot=!0},p(t,[e]){const Tt={};e&2&&(Tt.$$scope={dirty:e,ctx:t}),w.$set(Tt);const Mt={};e&2&&(Mt.$$scope={dirty:e,ctx:t}),T.$set(Mt)},i(t){ot||(h(M.$$.fragment,t),h(C.$$.fragment,t),h(b.$$.fragment,t),h(w.$$.fragment,t),h(T.$$.fragment,t),h(k.$$.fragment,t),h(P.$$.fragment,t),h(L.$$.fragment,t),h(B.$$.fragment,t),ot=!0)},o(t){y(M.$$.fragment,t),y(C.$$.fragment,t),y(b.$$.fragment,t),y(w.$$.fragment,t),y(T.$$.fragment,t),y(k.$$.fragment,t),y(P.$$.fragment,t),y(L.$$.fragment,t),y(B.$$.fragment,t),ot=!1},d(t){t&&(n(c),n(o),n(d),n(F),n(z),n(v),n(D),n(G),n(_),n(R),n(J),n(X),n(N),n(W),n(x),n(K),n(O),n(U),n(Z),n(I),n(Q),n(S),n(V),n(A),n(tt),n(et),n(H),n(nt),n(lt),n(j),n(st),n(E),n(at),n(it),n(Y)),n(s),$(M,t),$(C,t),$(b,t),$(w,t),$(T,t),$(k,t),$(P,t),$(L,t),$(B,t)}}}const Bt='{"title":"Set up your Argilla instance","local":"set-up-your-argilla-instance","sections":[{"title":"Deploy the Argilla UI","local":"deploy-the-argilla-ui","sections":[],"depth":2},{"title":"Install and connect the Python SDK","local":"install-and-connect-the-python-sdk","sections":[],"depth":2}],"depth":1}';function qt(q){return kt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xt extends Ut{constructor(s){super(),It(this,s,qt,Et,xt,{})}}export{Xt as component};
