import{s as dt,o as pt}from"../chunks/scheduler.d6170356.js";import{S as ct,i as ft,g as l,s as n,r as d,A as gt,h as s,f as o,c as i,j as ut,u as p,x as r,k as Ye,y as ht,a,v as c,d as f,t as g,w as h,m as mt,n as St}from"../chunks/index.fcd4cc08.js";import{T as bt}from"../chunks/Tip.b09c67cf.js";import{H as m,E as _t}from"../chunks/EditOnGithub.da2b595c.js";function $t(te){let u;return{c(){u=mt(`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.`)},l(S){u=St(S,`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.`)},m(S,$){a(S,u,$)},d(S){S&&o(u)}}}function Tt(te){let u,S,$,oe,T,ae,w,De=`<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.`,ne,y,ke=`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.`,ie,E,le,L,Be="You can deploy Label Studio on Spaces with just a few clicks:",se,b,ze='<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-to-spaces-lg.svg"/>',re,C,je="Spaces requires you to define:",ue,A,Ke=`<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,pe,O,qe=`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.`,ce,_,fe,R,We=`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.`,ge,x,he,P,Fe=`To make your Space production-ready, you will need to make three configuration
changes:`,me,M,Ze="<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,H,be,U,Je=`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>.`,_e,G,Qe=`<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,N,Ve=`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.`,Te,I,we,Y,Xe=`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.`,ye,D,et=`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.`,Ee,k,tt=`<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>`,Le,B,ot=`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.`,Ce,z,Ae,j,at=`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.`,ve,K,Oe,q,nt="<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>",Re,W,xe,F,it="<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>",Pe,Z,Me,J,lt="<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>",He,Q,Ue,V,st=`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>.`,Ge,X,Ne,ee,Ie;return T=new m({props:{title:"🟧 Label Studio on Spaces",local:"-label-studio-on-spaces",headingTag:"h1"}}),E=new m({props:{title:"⚡️ Deploy Label Studio on Spaces",local:"-deploy-label-studio-on-spaces",headingTag:"h2"}}),v=new m({props:{title:"🚀 Using the Default Configuration",local:"-using-the-default-configuration",headingTag:"h2"}}),_=new bt({props:{warning:!0,$$slots:{default:[$t]},$$scope:{ctx:te}}}),x=new m({props:{title:"🛠️ Configuring a Production-Ready Instance of Label Studio",local:"-configuring-a-production-ready-instance-of-label-studio",headingTag:"h2"}}),H=new m({props:{title:"Disable Unrestricted Creation of New Accounts",local:"disable-unrestricted-creation-of-new-accounts",headingTag:"h3"}}),I=new m({props:{title:"Enable Configuration Persistence",local:"enable-configuration-persistence",headingTag:"h3"}}),z=new m({props:{title:"Enable Cloud Storage",local:"enable-cloud-storage",headingTag:"h3"}}),K=new m({props:{title:"Amazon S3",local:"amazon-s3",headingTag:"h4"}}),W=new m({props:{title:"Google Cloud Storage",local:"google-cloud-storage",headingTag:"h4"}}),Z=new m({props:{title:"Azure Blob Storage",local:"azure-blob-storage",headingTag:"h4"}}),Q=new m({props:{title:"🤗 Next Steps, Feedback, and Support",local:"-next-steps-feedback-and-support",headingTag:"h2"}}),X=new _t({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker-label-studio.md"}}),{c(){u=l("meta"),S=n(),$=l("p"),oe=n(),d(T.$$.fragment),ae=n(),w=l("p"),w.innerHTML=De,ne=n(),y=l("p"),y.textContent=ke,ie=n(),d(E.$$.fragment),le=n(),L=l("p"),L.textContent=Be,se=n(),b=l("a"),b.innerHTML=ze,re=n(),C=l("p"),C.textContent=je,ue=n(),A=l("ul"),A.innerHTML=Ke,de=n(),d(v.$$.fragment),pe=n(),O=l("p"),O.textContent=qe,ce=n(),d(_.$$.fragment),fe=n(),R=l("p"),R.innerHTML=We,ge=n(),d(x.$$.fragment),he=n(),P=l("p"),P.textContent=Fe,me=n(),M=l("ul"),M.innerHTML=Ze,Se=n(),d(H.$$.fragment),be=n(),U=l("p"),U.innerHTML=Je,_e=n(),G=l("ul"),G.innerHTML=Qe,$e=n(),N=l("p"),N.innerHTML=Ve,Te=n(),d(I.$$.fragment),we=n(),Y=l("p"),Y.innerHTML=Xe,ye=n(),D=l("p"),D.textContent=et,Ee=n(),k=l("ul"),k.innerHTML=tt,Le=n(),B=l("p"),B.textContent=ot,Ce=n(),d(z.$$.fragment),Ae=n(),j=l("p"),j.innerHTML=at,ve=n(),d(K.$$.fragment),Oe=n(),q=l("ul"),q.innerHTML=nt,Re=n(),d(W.$$.fragment),xe=n(),F=l("ul"),F.innerHTML=it,Pe=n(),d(Z.$$.fragment),Me=n(),J=l("ul"),J.innerHTML=lt,He=n(),d(Q.$$.fragment),Ue=n(),V=l("p"),V.innerHTML=st,Ge=n(),d(X.$$.fragment),Ne=n(),ee=l("p"),this.h()},l(e){const t=gt("svelte-u9bgzb",document.head);u=s(t,"META",{name:!0,content:!0}),t.forEach(o),S=i(e),$=s(e,"P",{}),ut($).forEach(o),oe=i(e),p(T.$$.fragment,e),ae=i(e),w=s(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-1rv0u62"&&(w.innerHTML=De),ne=i(e),y=s(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-hmjd3t"&&(y.textContent=ke),ie=i(e),p(E.$$.fragment,e),le=i(e),L=s(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1wl7hvq"&&(L.textContent=Be),se=i(e),b=s(e,"A",{href:!0,"data-svelte-h":!0}),r(b)!=="svelte-q39mm4"&&(b.innerHTML=ze),re=i(e),C=s(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-zf4u24"&&(C.textContent=je),ue=i(e),A=s(e,"UL",{"data-svelte-h":!0}),r(A)!=="svelte-s4n4yw"&&(A.innerHTML=Ke),de=i(e),p(v.$$.fragment,e),pe=i(e),O=s(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-8oph0w"&&(O.textContent=qe),ce=i(e),p(_.$$.fragment,e),fe=i(e),R=s(e,"P",{"data-svelte-h":!0}),r(R)!=="svelte-19ntq6s"&&(R.innerHTML=We),ge=i(e),p(x.$$.fragment,e),he=i(e),P=s(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-1uy07io"&&(P.textContent=Fe),me=i(e),M=s(e,"UL",{"data-svelte-h":!0}),r(M)!=="svelte-b6pxba"&&(M.innerHTML=Ze),Se=i(e),p(H.$$.fragment,e),be=i(e),U=s(e,"P",{"data-svelte-h":!0}),r(U)!=="svelte-1wtsf11"&&(U.innerHTML=Je),_e=i(e),G=s(e,"UL",{"data-svelte-h":!0}),r(G)!=="svelte-1nfznj0"&&(G.innerHTML=Qe),$e=i(e),N=s(e,"P",{"data-svelte-h":!0}),r(N)!=="svelte-2s6qhr"&&(N.innerHTML=Ve),Te=i(e),p(I.$$.fragment,e),we=i(e),Y=s(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-grmueg"&&(Y.innerHTML=Xe),ye=i(e),D=s(e,"P",{"data-svelte-h":!0}),r(D)!=="svelte-1wk5r67"&&(D.textContent=et),Ee=i(e),k=s(e,"UL",{"data-svelte-h":!0}),r(k)!=="svelte-2i1l6o"&&(k.innerHTML=tt),Le=i(e),B=s(e,"P",{"data-svelte-h":!0}),r(B)!=="svelte-r9lm89"&&(B.textContent=ot),Ce=i(e),p(z.$$.fragment,e),Ae=i(e),j=s(e,"P",{"data-svelte-h":!0}),r(j)!=="svelte-1mq56yw"&&(j.innerHTML=at),ve=i(e),p(K.$$.fragment,e),Oe=i(e),q=s(e,"UL",{"data-svelte-h":!0}),r(q)!=="svelte-dhekiv"&&(q.innerHTML=nt),Re=i(e),p(W.$$.fragment,e),xe=i(e),F=s(e,"UL",{"data-svelte-h":!0}),r(F)!=="svelte-1yacqm5"&&(F.innerHTML=it),Pe=i(e),p(Z.$$.fragment,e),Me=i(e),J=s(e,"UL",{"data-svelte-h":!0}),r(J)!=="svelte-1m1d2oc"&&(J.innerHTML=lt),He=i(e),p(Q.$$.fragment,e),Ue=i(e),V=s(e,"P",{"data-svelte-h":!0}),r(V)!=="svelte-1u6m1vl"&&(V.innerHTML=st),Ge=i(e),p(X.$$.fragment,e),Ne=i(e),ee=s(e,"P",{}),ut(ee).forEach(o),this.h()},h(){Ye(u,"name","hf:doc:metadata"),Ye(u,"content",wt),Ye(b,"href","https://huggingface.co/new-space?template=LabelStudio/LabelStudio")},m(e,t){ht(document.head,u),a(e,S,t),a(e,$,t),a(e,oe,t),c(T,e,t),a(e,ae,t),a(e,w,t),a(e,ne,t),a(e,y,t),a(e,ie,t),c(E,e,t),a(e,le,t),a(e,L,t),a(e,se,t),a(e,b,t),a(e,re,t),a(e,C,t),a(e,ue,t),a(e,A,t),a(e,de,t),c(v,e,t),a(e,pe,t),a(e,O,t),a(e,ce,t),c(_,e,t),a(e,fe,t),a(e,R,t),a(e,ge,t),c(x,e,t),a(e,he,t),a(e,P,t),a(e,me,t),a(e,M,t),a(e,Se,t),c(H,e,t),a(e,be,t),a(e,U,t),a(e,_e,t),a(e,G,t),a(e,$e,t),a(e,N,t),a(e,Te,t),c(I,e,t),a(e,we,t),a(e,Y,t),a(e,ye,t),a(e,D,t),a(e,Ee,t),a(e,k,t),a(e,Le,t),a(e,B,t),a(e,Ce,t),c(z,e,t),a(e,Ae,t),a(e,j,t),a(e,ve,t),c(K,e,t),a(e,Oe,t),a(e,q,t),a(e,Re,t),c(W,e,t),a(e,xe,t),a(e,F,t),a(e,Pe,t),c(Z,e,t),a(e,Me,t),a(e,J,t),a(e,He,t),c(Q,e,t),a(e,Ue,t),a(e,V,t),a(e,Ge,t),c(X,e,t),a(e,Ne,t),a(e,ee,t),Ie=!0},p(e,[t]){const rt={};t&2&&(rt.$$scope={dirty:t,ctx:e}),_.$set(rt)},i(e){Ie||(f(T.$$.fragment,e),f(E.$$.fragment,e),f(v.$$.fragment,e),f(_.$$.fragment,e),f(x.$$.fragment,e),f(H.$$.fragment,e),f(I.$$.fragment,e),f(z.$$.fragment,e),f(K.$$.fragment,e),f(W.$$.fragment,e),f(Z.$$.fragment,e),f(Q.$$.fragment,e),f(X.$$.fragment,e),Ie=!0)},o(e){g(T.$$.fragment,e),g(E.$$.fragment,e),g(v.$$.fragment,e),g(_.$$.fragment,e),g(x.$$.fragment,e),g(H.$$.fragment,e),g(I.$$.fragment,e),g(z.$$.fragment,e),g(K.$$.fragment,e),g(W.$$.fragment,e),g(Z.$$.fragment,e),g(Q.$$.fragment,e),g(X.$$.fragment,e),Ie=!1},d(e){e&&(o(S),o($),o(oe),o(ae),o(w),o(ne),o(y),o(ie),o(le),o(L),o(se),o(b),o(re),o(C),o(ue),o(A),o(de),o(pe),o(O),o(ce),o(fe),o(R),o(ge),o(he),o(P),o(me),o(M),o(Se),o(be),o(U),o(_e),o(G),o($e),o(N),o(Te),o(we),o(Y),o(ye),o(D),o(Ee),o(k),o(Le),o(B),o(Ce),o(Ae),o(j),o(ve),o(Oe),o(q),o(Re),o(xe),o(F),o(Pe),o(Me),o(J),o(He),o(Ue),o(V),o(Ge),o(Ne),o(ee)),o(u),h(T,e),h(E,e),h(v,e),h(_,e),h(x,e),h(H,e),h(I,e),h(z,e),h(K,e),h(W,e),h(Z,e),h(Q,e),h(X,e)}}}const wt='{"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 yt(te){return pt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vt extends ct{constructor(u){super(),ft(this,u,yt,Tt,dt,{})}}export{vt as component};
