import{s as ct,n as ft,o as gt}from"../chunks/scheduler.9cda857a.js";import{S as ht,i as mt,e as n,s as a,c as u,h as bt,a as s,d as o,b as i,f as dt,g as p,j as r,k as Ye,l as St,m as l,n as d,t as c,o as f,p as g}from"../chunks/index.003612b0.js";import{C as _t}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{H as h,E as Tt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function $t(De){let m,te,X,oe,_,le,T,ae,$,Be=`<a href="https://labelstud.io" rel="nofollow">Label Studio</a> is an <a href="https://github.com/heartexlabs/label-studio" rel="nofollow">open-source data labeling
platform</a> for labeling,
annotating, and exploring many different data types. Additionally, Label Studio
includes a powerful <a href="https://labelstud.io/guide/ml.html" rel="nofollow">machine learning
interface</a> that can be used for new model
training, active learning, supervised learning, and many other training
techniques.`,ie,y,ze=`This guide will teach you how to deploy Label Studio for data
labeling and annotation within the Hugging Face Hub. You can use the default
configuration of Label Studio as a self-contained application hosted completely
on the Hub using Docker for demonstration and evaluation purposes, or you can
attach your own database and cloud storage to host a fully-featured
production-ready application hosted on Spaces.`,ne,w,se,E,Ke="You can deploy Label Studio on Spaces with just a few clicks:",re,b,je='<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-to-spaces-lg.svg"/>',ue,L,qe="Spaces requires you to define:",pe,C,We=`<li><p>An <strong>Owner</strong>: either your personal account or an organization you’re a
part of.</p></li> <li><p>A <strong>Space name</strong>: the name of the Space within the account
you’re creating the Space.</p></li> <li><p>The <strong>Visibility</strong>: <em>private</em> if you want the
Space to be visible only to you or your organization, or <em>public</em> if you want
it to be visible to other users or applications using the Label Studio API
(suggested).</p></li>`,de,v,ce,A,Fe=`By default, Label Studio is installed in Spaces with a configuration that uses
local storage for the application database to store configuration, account
credentials, and project information. Labeling tasks and data items are also held
in local storage.`,fe,S,Ze=`<p>Storage in Hugging Face Spaces is ephemeral, and the data you store in the default
configuration can be lost in a reboot or reset of the Space. Because of this,
we strongly encourage you to use the default configuration only for testing and
demonstration purposes.</p>`,ge,O,Je=`After launching Label Studio, you will be presented with the standard login
screen. You can start by creating a new account using your email address and
logging in with your new credentials. Periodically after logging in, Label
Studio will warn you that the storage is ephemeral and data could be
lost if your Space is restarted. You will also be preset with a prompt from
Heidi, the helpful Label Studio mascot, to create a new project to start
labeling your data. To get started, check out the Label Studio <a href="https://labelstud.io/blog/introduction-to-label-studio-in-hugging-face-spaces/" rel="nofollow">“Zero to One”
tutorial</a>
with a guide on how to build an annotation interface for sentiment analysis.`,he,R,me,x,Qe=`To make your Space production-ready, you will need to make three configuration
changes:`,be,P,Ve="<li><p>Disable the unrestricted creation of new accounts.</p></li> <li><p>Enable persistence by attaching an external database.</p></li> <li><p>Attach cloud storage for labeling tasks.</p></li>",Se,M,_e,H,Xe=`The default configuration on Label Studio allows for the unrestricted creation
of new accounts for anyone who has the URL for your application. You can
<a href="https://labelstud.io/guide/signup.html#Restrict-signup-for-local-deployments" rel="nofollow">restrict signups</a>
by adding the following configuration secrets to your Space <strong>Settings</strong>.`,Te,U,et=`<li><p><code>LABEL_STUDIO_DISABLE_SIGNUP_WITHOUT_LINK</code>: Setting this value to <code>true</code> will
disable unrestricted account creation.</p></li> <li><p><code>LABEL_STUDIO_USERNAME</code>: This is the username of the account that you will
use as the first user in your Label Studio Space. It should be a valid email
address.</p></li> <li><p><code>LABEL_STUDIO_PASSWORD</code>: The password that will be associated with the first
user account.</p></li>`,$e,G,tt=`Restart the Space to apply these settings. The ability to create new accounts
from the login screen will be disabled. To create new accounts, you will need
to invite new users in the <code>Organization</code> settings in the Label Studio
application.`,ye,N,we,I,ot=`By default, this Space stores all project configuration and data annotations in
local storage with SQLite. If the Space is reset, all configuration and
annotation data in the Space will be lost. You can enable configuration
persistence by <a href="https://labelstud.io/guide/storedata.html#PostgreSQL-database" rel="nofollow">connecting an external Postgres database to your
space</a>,
guaranteeing that all project and annotation settings are preserved.`,Ee,k,lt=`Set the following secret variables to match your own hosted instance of
Postgres. We strongly recommend setting these as secrets to prevent leaking
information about your database service to the public in your spaces
definition.`,Le,Y,at=`<li><p><code>DJANGO_DB</code>: Set this to <code>default</code>.</p></li> <li><p><code>POSTGRE_NAME</code>: Set this to the name of the Postgres database.</p></li> <li><p><code>POSTGRE_USER</code>: Set this to the Postgres username.</p></li> <li><p><code>POSTGRE_PASSWORD</code>: Set this to the password for your Postgres user.</p></li> <li><p><code>POSTGRE_HOST</code>: Set this to the host that your Postgres database is running
on.</p></li> <li><p><code>POSTGRE_PORT</code>: Set this to the port that your Pogtgres database is running
on.</p></li> <li><p><code>STORAGE_PERSISTENCE</code>: Set this to <code>1</code> to remove the warning about ephemeral
storage.</p></li>`,Ce,D,it=`Restart the Space to apply these settings. Information about users, projects,
and annotations will be stored in the database, and will be reloaded by Label
Studio if the space is restarted or reset.`,ve,B,Ae,z,nt=`By default, the only data storage enabled for this Space is local. In the case
of a Space reset, all data will be lost. To enable permanent storage, you must
enable a <a href="https://labelstud.io/guide/storage.html" rel="nofollow">cloud storage connector</a>.
Choose the appropriate cloud connector and configure the secrets for it.`,Oe,K,Re,j,st="<li><p><code>STORAGE_TYPE</code>: Set this to <code>s3</code>.</p></li> <li><p><code>STORAGE_AWS_ACCESS_KEY_ID</code>: <code>&lt;YOUR_ACCESS_KEY_ID&gt;</code></p></li> <li><p><code>STORAGE_AWS_SECRET_ACCESS_KEY</code>: <code>&lt;YOUR_SECRET_ACCESS_KEY&gt;</code></p></li> <li><p><code>STORAGE_AWS_BUCKET_NAME</code>: <code>&lt;YOUR_BUCKET_NAME&gt;</code></p></li> <li><p><code>STORAGE_AWS_REGION_NAME</code>: <code>&lt;YOUR_BUCKET_REGION&gt;</code></p></li> <li><p><code>STORAGE_AWS_FOLDER</code>: Set this to an empty string.</p></li>",xe,q,Pe,W,rt="<li><p><code>STORAGE_TYPE</code>: Set this to <code>gcs</code>.</p></li> <li><p><code>STORAGE_GCS_BUCKET_NAME</code>: <code>&lt;YOUR_BUCKET_NAME&gt;</code></p></li> <li><p><code>STORAGE_GCS_PROJECT_ID</code>: <code>&lt;YOUR_PROJECT_ID&gt;</code></p></li> <li><p><code>STORAGE_GCS_FOLDER</code>: Set this to an empty string.</p></li> <li><p><code>GOOGLE_APPLICATION_CREDENTIALS</code>: Set this to <code>/opt/heartex/secrets/key.json</code>.</p></li>",Me,F,He,Z,ut="<li><p><code>STORAGE_TYPE</code>: Set this to <code>azure</code>.</p></li> <li><p><code>STORAGE_AZURE_ACCOUNT_NAME</code>: <code>&lt;YOUR_STORAGE_ACCOUNT&gt;</code></p></li> <li><p><code>STORAGE_AZURE_ACCOUNT_KEY</code>: <code>&lt;YOUR_STORAGE_KEY&gt;</code></p></li> <li><p><code>STORAGE_AZURE_CONTAINER_NAME</code>: <code>&lt;YOUR_CONTAINER_NAME&gt;</code></p></li> <li><p><code>STORAGE_AZURE_FOLDER</code>: Set this to an empty string.</p></li>",Ue,J,Ge,Q,pt=`To get started with Label Studio, check out the Label Studio <a href="https://labelstud.io/blog/introduction-to-label-studio-in-hugging-face-spaces/" rel="nofollow">“Zero to One”
tutorial</a>,
which walks you through an example sentiment analysis annotation project. You
can find a full set of resources about Label Studio and the Label Studio
community on at the <a href="https://labelstud.io" rel="nofollow">Label Studio Home Page</a>. This
includes <a href="https://labelstud.io/guide/" rel="nofollow">full documentation</a>, an <a href="https://labelstud.io/playground/" rel="nofollow">interactive
playground</a> for trying out different
annotation interfaces, and links to join the <a href="https://slack.labelstudio.heartex.com/?source=spaces" rel="nofollow">Label Studio Slack
Community</a>.`,Ne,V,Ie,ee,ke;return _=new _t({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=new h({props:{title:"🟧 Label Studio on Spaces",local:"-label-studio-on-spaces",headingTag:"h1"}}),w=new h({props:{title:"⚡️ Deploy Label Studio on Spaces",local:"-deploy-label-studio-on-spaces",headingTag:"h2"}}),v=new h({props:{title:"🚀 Using the Default Configuration",local:"-using-the-default-configuration",headingTag:"h2"}}),R=new h({props:{title:"🛠️ Configuring a Production-Ready Instance of Label Studio",local:"-configuring-a-production-ready-instance-of-label-studio",headingTag:"h2"}}),M=new h({props:{title:"Disable Unrestricted Creation of New Accounts",local:"disable-unrestricted-creation-of-new-accounts",headingTag:"h3"}}),N=new h({props:{title:"Enable Configuration Persistence",local:"enable-configuration-persistence",headingTag:"h3"}}),B=new h({props:{title:"Enable Cloud Storage",local:"enable-cloud-storage",headingTag:"h3"}}),K=new h({props:{title:"Amazon S3",local:"amazon-s3",headingTag:"h4"}}),q=new h({props:{title:"Google Cloud Storage",local:"google-cloud-storage",headingTag:"h4"}}),F=new h({props:{title:"Azure Blob Storage",local:"azure-blob-storage",headingTag:"h4"}}),J=new h({props:{title:"🤗 Next Steps, Feedback, and Support",local:"-next-steps-feedback-and-support",headingTag:"h2"}}),V=new Tt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker-label-studio.md"}}),{c(){m=n("meta"),te=a(),X=n("p"),oe=a(),u(_.$$.fragment),le=a(),u(T.$$.fragment),ae=a(),$=n("p"),$.innerHTML=Be,ie=a(),y=n("p"),y.textContent=ze,ne=a(),u(w.$$.fragment),se=a(),E=n("p"),E.textContent=Ke,re=a(),b=n("a"),b.innerHTML=je,ue=a(),L=n("p"),L.textContent=qe,pe=a(),C=n("ul"),C.innerHTML=We,de=a(),u(v.$$.fragment),ce=a(),A=n("p"),A.textContent=Fe,fe=a(),S=n("blockquote"),S.innerHTML=Ze,ge=a(),O=n("p"),O.innerHTML=Je,he=a(),u(R.$$.fragment),me=a(),x=n("p"),x.textContent=Qe,be=a(),P=n("ul"),P.innerHTML=Ve,Se=a(),u(M.$$.fragment),_e=a(),H=n("p"),H.innerHTML=Xe,Te=a(),U=n("ul"),U.innerHTML=et,$e=a(),G=n("p"),G.innerHTML=tt,ye=a(),u(N.$$.fragment),we=a(),I=n("p"),I.innerHTML=ot,Ee=a(),k=n("p"),k.textContent=lt,Le=a(),Y=n("ul"),Y.innerHTML=at,Ce=a(),D=n("p"),D.textContent=it,ve=a(),u(B.$$.fragment),Ae=a(),z=n("p"),z.innerHTML=nt,Oe=a(),u(K.$$.fragment),Re=a(),j=n("ul"),j.innerHTML=st,xe=a(),u(q.$$.fragment),Pe=a(),W=n("ul"),W.innerHTML=rt,Me=a(),u(F.$$.fragment),He=a(),Z=n("ul"),Z.innerHTML=ut,Ue=a(),u(J.$$.fragment),Ge=a(),Q=n("p"),Q.innerHTML=pt,Ne=a(),u(V.$$.fragment),Ie=a(),ee=n("p"),this.h()},l(e){const t=bt("svelte-u9bgzb",document.head);m=s(t,"META",{name:!0,content:!0}),t.forEach(o),te=i(e),X=s(e,"P",{}),dt(X).forEach(o),oe=i(e),p(_.$$.fragment,e),le=i(e),p(T.$$.fragment,e),ae=i(e),$=s(e,"P",{"data-svelte-h":!0}),r($)!=="svelte-1rv0u62"&&($.innerHTML=Be),ie=i(e),y=s(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-hmjd3t"&&(y.textContent=ze),ne=i(e),p(w.$$.fragment,e),se=i(e),E=s(e,"P",{"data-svelte-h":!0}),r(E)!=="svelte-1wl7hvq"&&(E.textContent=Ke),re=i(e),b=s(e,"A",{href:!0,"data-svelte-h":!0}),r(b)!=="svelte-q39mm4"&&(b.innerHTML=je),ue=i(e),L=s(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-zf4u24"&&(L.textContent=qe),pe=i(e),C=s(e,"UL",{"data-svelte-h":!0}),r(C)!=="svelte-s4n4yw"&&(C.innerHTML=We),de=i(e),p(v.$$.fragment,e),ce=i(e),A=s(e,"P",{"data-svelte-h":!0}),r(A)!=="svelte-8oph0w"&&(A.textContent=Fe),fe=i(e),S=s(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(S)!=="svelte-16em6nc"&&(S.innerHTML=Ze),ge=i(e),O=s(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-19ntq6s"&&(O.innerHTML=Je),he=i(e),p(R.$$.fragment,e),me=i(e),x=s(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1uy07io"&&(x.textContent=Qe),be=i(e),P=s(e,"UL",{"data-svelte-h":!0}),r(P)!=="svelte-b6pxba"&&(P.innerHTML=Ve),Se=i(e),p(M.$$.fragment,e),_e=i(e),H=s(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-1wtsf11"&&(H.innerHTML=Xe),Te=i(e),U=s(e,"UL",{"data-svelte-h":!0}),r(U)!=="svelte-1nfznj0"&&(U.innerHTML=et),$e=i(e),G=s(e,"P",{"data-svelte-h":!0}),r(G)!=="svelte-2s6qhr"&&(G.innerHTML=tt),ye=i(e),p(N.$$.fragment,e),we=i(e),I=s(e,"P",{"data-svelte-h":!0}),r(I)!=="svelte-grmueg"&&(I.innerHTML=ot),Ee=i(e),k=s(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-1wk5r67"&&(k.textContent=lt),Le=i(e),Y=s(e,"UL",{"data-svelte-h":!0}),r(Y)!=="svelte-2i1l6o"&&(Y.innerHTML=at),Ce=i(e),D=s(e,"P",{"data-svelte-h":!0}),r(D)!=="svelte-r9lm89"&&(D.textContent=it),ve=i(e),p(B.$$.fragment,e),Ae=i(e),z=s(e,"P",{"data-svelte-h":!0}),r(z)!=="svelte-1mq56yw"&&(z.innerHTML=nt),Oe=i(e),p(K.$$.fragment,e),Re=i(e),j=s(e,"UL",{"data-svelte-h":!0}),r(j)!=="svelte-dhekiv"&&(j.innerHTML=st),xe=i(e),p(q.$$.fragment,e),Pe=i(e),W=s(e,"UL",{"data-svelte-h":!0}),r(W)!=="svelte-1yacqm5"&&(W.innerHTML=rt),Me=i(e),p(F.$$.fragment,e),He=i(e),Z=s(e,"UL",{"data-svelte-h":!0}),r(Z)!=="svelte-1m1d2oc"&&(Z.innerHTML=ut),Ue=i(e),p(J.$$.fragment,e),Ge=i(e),Q=s(e,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-1u6m1vl"&&(Q.innerHTML=pt),Ne=i(e),p(V.$$.fragment,e),Ie=i(e),ee=s(e,"P",{}),dt(ee).forEach(o),this.h()},h(){Ye(m,"name","hf:doc:metadata"),Ye(m,"content",yt),Ye(b,"href","https://huggingface.co/new-space?template=LabelStudio/LabelStudio"),Ye(S,"class","warning")},m(e,t){St(document.head,m),l(e,te,t),l(e,X,t),l(e,oe,t),d(_,e,t),l(e,le,t),d(T,e,t),l(e,ae,t),l(e,$,t),l(e,ie,t),l(e,y,t),l(e,ne,t),d(w,e,t),l(e,se,t),l(e,E,t),l(e,re,t),l(e,b,t),l(e,ue,t),l(e,L,t),l(e,pe,t),l(e,C,t),l(e,de,t),d(v,e,t),l(e,ce,t),l(e,A,t),l(e,fe,t),l(e,S,t),l(e,ge,t),l(e,O,t),l(e,he,t),d(R,e,t),l(e,me,t),l(e,x,t),l(e,be,t),l(e,P,t),l(e,Se,t),d(M,e,t),l(e,_e,t),l(e,H,t),l(e,Te,t),l(e,U,t),l(e,$e,t),l(e,G,t),l(e,ye,t),d(N,e,t),l(e,we,t),l(e,I,t),l(e,Ee,t),l(e,k,t),l(e,Le,t),l(e,Y,t),l(e,Ce,t),l(e,D,t),l(e,ve,t),d(B,e,t),l(e,Ae,t),l(e,z,t),l(e,Oe,t),d(K,e,t),l(e,Re,t),l(e,j,t),l(e,xe,t),d(q,e,t),l(e,Pe,t),l(e,W,t),l(e,Me,t),d(F,e,t),l(e,He,t),l(e,Z,t),l(e,Ue,t),d(J,e,t),l(e,Ge,t),l(e,Q,t),l(e,Ne,t),d(V,e,t),l(e,Ie,t),l(e,ee,t),ke=!0},p:ft,i(e){ke||(c(_.$$.fragment,e),c(T.$$.fragment,e),c(w.$$.fragment,e),c(v.$$.fragment,e),c(R.$$.fragment,e),c(M.$$.fragment,e),c(N.$$.fragment,e),c(B.$$.fragment,e),c(K.$$.fragment,e),c(q.$$.fragment,e),c(F.$$.fragment,e),c(J.$$.fragment,e),c(V.$$.fragment,e),ke=!0)},o(e){f(_.$$.fragment,e),f(T.$$.fragment,e),f(w.$$.fragment,e),f(v.$$.fragment,e),f(R.$$.fragment,e),f(M.$$.fragment,e),f(N.$$.fragment,e),f(B.$$.fragment,e),f(K.$$.fragment,e),f(q.$$.fragment,e),f(F.$$.fragment,e),f(J.$$.fragment,e),f(V.$$.fragment,e),ke=!1},d(e){e&&(o(te),o(X),o(oe),o(le),o(ae),o($),o(ie),o(y),o(ne),o(se),o(E),o(re),o(b),o(ue),o(L),o(pe),o(C),o(de),o(ce),o(A),o(fe),o(S),o(ge),o(O),o(he),o(me),o(x),o(be),o(P),o(Se),o(_e),o(H),o(Te),o(U),o($e),o(G),o(ye),o(we),o(I),o(Ee),o(k),o(Le),o(Y),o(Ce),o(D),o(ve),o(Ae),o(z),o(Oe),o(Re),o(j),o(xe),o(Pe),o(W),o(Me),o(He),o(Z),o(Ue),o(Ge),o(Q),o(Ne),o(Ie),o(ee)),o(m),g(_,e),g(T,e),g(w,e),g(v,e),g(R,e),g(M,e),g(N,e),g(B,e),g(K,e),g(q,e),g(F,e),g(J,e),g(V,e)}}}const yt='{"title":"🟧 Label Studio on Spaces","local":"-label-studio-on-spaces","sections":[{"title":"⚡️ Deploy Label Studio on Spaces","local":"-deploy-label-studio-on-spaces","sections":[],"depth":2},{"title":"🚀 Using the Default Configuration","local":"-using-the-default-configuration","sections":[],"depth":2},{"title":"🛠️ Configuring a Production-Ready Instance of Label Studio","local":"-configuring-a-production-ready-instance-of-label-studio","sections":[{"title":"Disable Unrestricted Creation of New Accounts","local":"disable-unrestricted-creation-of-new-accounts","sections":[],"depth":3},{"title":"Enable Configuration Persistence","local":"enable-configuration-persistence","sections":[],"depth":3},{"title":"Enable Cloud Storage","local":"enable-cloud-storage","sections":[{"title":"Amazon S3","local":"amazon-s3","sections":[],"depth":4},{"title":"Google Cloud Storage","local":"google-cloud-storage","sections":[],"depth":4},{"title":"Azure Blob Storage","local":"azure-blob-storage","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"🤗 Next Steps, Feedback, and Support","local":"-next-steps-feedback-and-support","sections":[],"depth":2}],"depth":1}';function wt(De){return gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class At extends ht{constructor(m){super(),mt(this,m,wt,$t,ct,{})}}export{At as component};
