import{s as bt,f as Ct,o as _t,n as Jt}from"../chunks/scheduler.37c15a92.js";import{S as vt,i as It,g as o,s as a,r as g,A as kt,h as r,f as n,c as s,j as Tt,u as m,x as u,k as it,y as xt,a as l,v as f,d as h,t as y,w as $}from"../chunks/index.2bf4358c.js";import{T as Ut}from"../chunks/Tip.363c041f.js";import{C as Mt}from"../chunks/CodeBlock.4f5fc1ad.js";import{C as At}from"../chunks/CourseFloatingBanner.15ba07e6.js";import{H as ot,E as Pt}from"../chunks/EditOnGithub.8916dc7c.js";function St(B){let i,d=`⚠️ 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(){i=o("p"),i.innerHTML=d},l(p){i=r(p,"P",{"data-svelte-h":!0}),u(i)!=="svelte-r4sefo"&&(i.innerHTML=d)},m(p,L){l(p,i,L)},p:Jt,d(p){p&&n(i)}}}function jt(B){let i,d,p,L,w,Y,T,F,M,rt="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.",z,b,G,C,pt='The easiest way to set up your Argilla instance is through Hugging Face Spaces. To create your Argilla Space, simply follow <a href="https://huggingface.co/new-space?template=argilla%2Fargilla-template-space" rel="nofollow">this form</a>. If you need further guidance, check the <a href="https://docs.argilla.io/latest/getting_started/quickstart/" rel="nofollow">Argilla quickstart</a>.',R,_,ut,X,c,D,J,ct="Once Argilla is up and running, you can log in with your credentials.",N,v,W,I,gt="Now you can go to your Python environment or notebook and install the argilla library:",Z,k,mt="<code>!pip install argilla</code>",K,x,ft="Let’s connect with our Argilla instance. To do that you will need the following information:",O,U,ht="<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>",Q,A,V,P,yt="To check that everything is working properly, we’ll call <code>me</code>. This should return our user:",tt,S,et,j,$t="If this worked, your Argilla instance is up and running and you’re connected to it! Congrats!",nt,E,dt="We can now get started with loading our first dataset to Argilla.",lt,H,at,q,st;return w=new ot({props:{title:"Set up your Argilla instance",local:"set-up-your-argilla-instance",headingTag:"h1"}}),T=new At({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 ot({props:{title:"Deploy the Argilla UI",local:"deploy-the-argilla-ui",headingTag:"h2"}}),c=new Ut({props:{warning:!0,$$slots:{default:[St]},$$scope:{ctx:B}}}),v=new ot({props:{title:"Install and connect the Python SDK",local:"install-and-connect-the-python-sdk",headingTag:"h2"}}),A=new Mt({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}}),S=new Mt({props:{code:"Y2xpZW50Lm1l",highlighted:"client.me",wrap:!1}}),H=new Pt({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter10/2.mdx"}}),{c(){i=o("meta"),d=a(),p=o("p"),L=a(),g(w.$$.fragment),Y=a(),g(T.$$.fragment),F=a(),M=o("p"),M.textContent=rt,z=a(),g(b.$$.fragment),G=a(),C=o("p"),C.innerHTML=pt,R=a(),_=o("img"),X=a(),g(c.$$.fragment),D=a(),J=o("p"),J.textContent=ct,N=a(),g(v.$$.fragment),W=a(),I=o("p"),I.textContent=gt,Z=a(),k=o("p"),k.innerHTML=mt,K=a(),x=o("p"),x.textContent=ft,O=a(),U=o("ul"),U.innerHTML=ht,Q=a(),g(A.$$.fragment),V=a(),P=o("p"),P.innerHTML=yt,tt=a(),g(S.$$.fragment),et=a(),j=o("p"),j.textContent=$t,nt=a(),E=o("p"),E.textContent=dt,lt=a(),g(H.$$.fragment),at=a(),q=o("p"),this.h()},l(t){const e=kt("svelte-u9bgzb",document.head);i=r(e,"META",{name:!0,content:!0}),e.forEach(n),d=s(t),p=r(t,"P",{}),Tt(p).forEach(n),L=s(t),m(w.$$.fragment,t),Y=s(t),m(T.$$.fragment,t),F=s(t),M=r(t,"P",{"data-svelte-h":!0}),u(M)!=="svelte-q065f"&&(M.textContent=rt),z=s(t),m(b.$$.fragment,t),G=s(t),C=r(t,"P",{"data-svelte-h":!0}),u(C)!=="svelte-q13gin"&&(C.innerHTML=pt),R=s(t),_=r(t,"IMG",{src:!0,alt:!0}),X=s(t),m(c.$$.fragment,t),D=s(t),J=r(t,"P",{"data-svelte-h":!0}),u(J)!=="svelte-zgnnl3"&&(J.textContent=ct),N=s(t),m(v.$$.fragment,t),W=s(t),I=r(t,"P",{"data-svelte-h":!0}),u(I)!=="svelte-1ylnx4"&&(I.textContent=gt),Z=s(t),k=r(t,"P",{"data-svelte-h":!0}),u(k)!=="svelte-7zjbtm"&&(k.innerHTML=mt),K=s(t),x=r(t,"P",{"data-svelte-h":!0}),u(x)!=="svelte-v96que"&&(x.textContent=ft),O=s(t),U=r(t,"UL",{"data-svelte-h":!0}),u(U)!=="svelte-1ok4akm"&&(U.innerHTML=ht),Q=s(t),m(A.$$.fragment,t),V=s(t),P=r(t,"P",{"data-svelte-h":!0}),u(P)!=="svelte-fber77"&&(P.innerHTML=yt),tt=s(t),m(S.$$.fragment,t),et=s(t),j=r(t,"P",{"data-svelte-h":!0}),u(j)!=="svelte-el50rm"&&(j.textContent=$t),nt=s(t),E=r(t,"P",{"data-svelte-h":!0}),u(E)!=="svelte-q3cjsu"&&(E.textContent=dt),lt=s(t),m(H.$$.fragment,t),at=s(t),q=r(t,"P",{}),Tt(q).forEach(n),this.h()},h(){it(i,"name","hf:doc:metadata"),it(i,"content",Et),Ct(_.src,ut="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter10/space_config.png")||it(_,"src",ut),it(_,"alt","Space configuration form.")},m(t,e){xt(document.head,i),l(t,d,e),l(t,p,e),l(t,L,e),f(w,t,e),l(t,Y,e),f(T,t,e),l(t,F,e),l(t,M,e),l(t,z,e),f(b,t,e),l(t,G,e),l(t,C,e),l(t,R,e),l(t,_,e),l(t,X,e),f(c,t,e),l(t,D,e),l(t,J,e),l(t,N,e),f(v,t,e),l(t,W,e),l(t,I,e),l(t,Z,e),l(t,k,e),l(t,K,e),l(t,x,e),l(t,O,e),l(t,U,e),l(t,Q,e),f(A,t,e),l(t,V,e),l(t,P,e),l(t,tt,e),f(S,t,e),l(t,et,e),l(t,j,e),l(t,nt,e),l(t,E,e),l(t,lt,e),f(H,t,e),l(t,at,e),l(t,q,e),st=!0},p(t,[e]){const wt={};e&2&&(wt.$$scope={dirty:e,ctx:t}),c.$set(wt)},i(t){st||(h(w.$$.fragment,t),h(T.$$.fragment,t),h(b.$$.fragment,t),h(c.$$.fragment,t),h(v.$$.fragment,t),h(A.$$.fragment,t),h(S.$$.fragment,t),h(H.$$.fragment,t),st=!0)},o(t){y(w.$$.fragment,t),y(T.$$.fragment,t),y(b.$$.fragment,t),y(c.$$.fragment,t),y(v.$$.fragment,t),y(A.$$.fragment,t),y(S.$$.fragment,t),y(H.$$.fragment,t),st=!1},d(t){t&&(n(d),n(p),n(L),n(Y),n(F),n(M),n(z),n(G),n(C),n(R),n(_),n(X),n(D),n(J),n(N),n(W),n(I),n(Z),n(k),n(K),n(x),n(O),n(U),n(Q),n(V),n(P),n(tt),n(et),n(j),n(nt),n(E),n(lt),n(at),n(q)),n(i),$(w,t),$(T,t),$(b,t),$(c,t),$(v,t),$(A,t),$(S,t),$(H,t)}}}const Et='{"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 Ht(B){return _t(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gt extends vt{constructor(i){super(),It(this,i,Ht,jt,bt,{})}}export{Gt as component};
