import{s as Jt,a as vt,n as xt,o as _t}from"../chunks/scheduler.cc52f4b9.js";import{S as kt,i as It,e as i,s as a,c,h as Ut,a as o,d as l,b as s,f as bt,g,j as r,k as H,l as At,m as n,n as m,t as f,o as h,p as y}from"../chunks/index.5b747fde.js";import{C as St,H as rt,E as Pt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d38ac5a9.js";import{C as Ct}from"../chunks/CodeBlock.665bfc37.js";import{C as Lt}from"../chunks/CourseFloatingBanner.b33fcd79.js";function jt(pt){let p,B,q,Y,$,z,d,F,w,G,T,ut="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.",R,M,X,b,ct='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>.',D,C,gt,N,u,mt=`<p>⚠️ 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.</p>`,W,J,ft="Once Argilla is up and running, you can log in with your credentials.",O,v,K,x,ht="Now you can go to your Python environment or notebook and install the argilla library:",Q,_,yt="<code>!pip install argilla</code>",Z,k,$t="Let’s connect with our Argilla instance. To do that you will need the following information:",V,I,dt="<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,U,et,A,wt="To check that everything is working properly, we’ll call <code>me</code>. This should return our user:",lt,S,nt,P,Tt="If this worked, your Argilla instance is up and running and you’re connected to it! Congrats!",at,L,Mt="We can now get started with loading our first dataset to Argilla.",st,j,it,E,ot;return $=new St({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),d=new rt({props:{title:"Set up your Argilla instance",local:"set-up-your-argilla-instance",headingTag:"h1"}}),w=new Lt({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"}]}}),M=new rt({props:{title:"Deploy the Argilla UI",local:"deploy-the-argilla-ui",headingTag:"h2"}}),v=new rt({props:{title:"Install and connect the Python SDK",local:"install-and-connect-the-python-sdk",headingTag:"h2"}}),U=new Ct({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 Ct({props:{code:"Y2xpZW50Lm1l",highlighted:"client.me",wrap:!1}}),j=new Pt({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter10/2.mdx"}}),{c(){p=i("meta"),B=a(),q=i("p"),Y=a(),c($.$$.fragment),z=a(),c(d.$$.fragment),F=a(),c(w.$$.fragment),G=a(),T=i("p"),T.textContent=ut,R=a(),c(M.$$.fragment),X=a(),b=i("p"),b.innerHTML=ct,D=a(),C=i("img"),N=a(),u=i("blockquote"),u.innerHTML=mt,W=a(),J=i("p"),J.textContent=ft,O=a(),c(v.$$.fragment),K=a(),x=i("p"),x.textContent=ht,Q=a(),_=i("p"),_.innerHTML=yt,Z=a(),k=i("p"),k.textContent=$t,V=a(),I=i("ul"),I.innerHTML=dt,tt=a(),c(U.$$.fragment),et=a(),A=i("p"),A.innerHTML=wt,lt=a(),c(S.$$.fragment),nt=a(),P=i("p"),P.textContent=Tt,at=a(),L=i("p"),L.textContent=Mt,st=a(),c(j.$$.fragment),it=a(),E=i("p"),this.h()},l(t){const e=Ut("svelte-u9bgzb",document.head);p=o(e,"META",{name:!0,content:!0}),e.forEach(l),B=s(t),q=o(t,"P",{}),bt(q).forEach(l),Y=s(t),g($.$$.fragment,t),z=s(t),g(d.$$.fragment,t),F=s(t),g(w.$$.fragment,t),G=s(t),T=o(t,"P",{"data-svelte-h":!0}),r(T)!=="svelte-q065f"&&(T.textContent=ut),R=s(t),g(M.$$.fragment,t),X=s(t),b=o(t,"P",{"data-svelte-h":!0}),r(b)!=="svelte-q13gin"&&(b.innerHTML=ct),D=s(t),C=o(t,"IMG",{src:!0,alt:!0}),N=s(t),u=o(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(u)!=="svelte-rwfq96"&&(u.innerHTML=mt),W=s(t),J=o(t,"P",{"data-svelte-h":!0}),r(J)!=="svelte-zgnnl3"&&(J.textContent=ft),O=s(t),g(v.$$.fragment,t),K=s(t),x=o(t,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1ylnx4"&&(x.textContent=ht),Q=s(t),_=o(t,"P",{"data-svelte-h":!0}),r(_)!=="svelte-7zjbtm"&&(_.innerHTML=yt),Z=s(t),k=o(t,"P",{"data-svelte-h":!0}),r(k)!=="svelte-v96que"&&(k.textContent=$t),V=s(t),I=o(t,"UL",{"data-svelte-h":!0}),r(I)!=="svelte-1ok4akm"&&(I.innerHTML=dt),tt=s(t),g(U.$$.fragment,t),et=s(t),A=o(t,"P",{"data-svelte-h":!0}),r(A)!=="svelte-fber77"&&(A.innerHTML=wt),lt=s(t),g(S.$$.fragment,t),nt=s(t),P=o(t,"P",{"data-svelte-h":!0}),r(P)!=="svelte-el50rm"&&(P.textContent=Tt),at=s(t),L=o(t,"P",{"data-svelte-h":!0}),r(L)!=="svelte-q3cjsu"&&(L.textContent=Mt),st=s(t),g(j.$$.fragment,t),it=s(t),E=o(t,"P",{}),bt(E).forEach(l),this.h()},h(){H(p,"name","hf:doc:metadata"),H(p,"content",qt),vt(C.src,gt="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter10/space_config.png")||H(C,"src",gt),H(C,"alt","Space configuration form."),H(u,"class","warning")},m(t,e){At(document.head,p),n(t,B,e),n(t,q,e),n(t,Y,e),m($,t,e),n(t,z,e),m(d,t,e),n(t,F,e),m(w,t,e),n(t,G,e),n(t,T,e),n(t,R,e),m(M,t,e),n(t,X,e),n(t,b,e),n(t,D,e),n(t,C,e),n(t,N,e),n(t,u,e),n(t,W,e),n(t,J,e),n(t,O,e),m(v,t,e),n(t,K,e),n(t,x,e),n(t,Q,e),n(t,_,e),n(t,Z,e),n(t,k,e),n(t,V,e),n(t,I,e),n(t,tt,e),m(U,t,e),n(t,et,e),n(t,A,e),n(t,lt,e),m(S,t,e),n(t,nt,e),n(t,P,e),n(t,at,e),n(t,L,e),n(t,st,e),m(j,t,e),n(t,it,e),n(t,E,e),ot=!0},p:xt,i(t){ot||(f($.$$.fragment,t),f(d.$$.fragment,t),f(w.$$.fragment,t),f(M.$$.fragment,t),f(v.$$.fragment,t),f(U.$$.fragment,t),f(S.$$.fragment,t),f(j.$$.fragment,t),ot=!0)},o(t){h($.$$.fragment,t),h(d.$$.fragment,t),h(w.$$.fragment,t),h(M.$$.fragment,t),h(v.$$.fragment,t),h(U.$$.fragment,t),h(S.$$.fragment,t),h(j.$$.fragment,t),ot=!1},d(t){t&&(l(B),l(q),l(Y),l(z),l(F),l(G),l(T),l(R),l(X),l(b),l(D),l(C),l(N),l(u),l(W),l(J),l(O),l(K),l(x),l(Q),l(_),l(Z),l(k),l(V),l(I),l(tt),l(et),l(A),l(lt),l(nt),l(P),l(at),l(L),l(st),l(it),l(E)),l(p),y($,t),y(d,t),y(w,t),y(M,t),y(v,t),y(U,t),y(S,t),y(j,t)}}}const qt='{"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 Et(pt){return _t(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gt extends kt{constructor(p){super(),It(this,p,Et,jt,Jt,{})}}export{Gt as component};
