import{s as rt,o as ut}from"../chunks/scheduler.d6170356.js";import{S as dt,i as pt,g as i,s as l,r as d,A as ct,h as s,f as o,c as n,j as st,u as p,x as r,k as Ne,y as ft,a,v as c,d as f,t as g,w as h,m as gt,n as ht}from"../chunks/index.fcd4cc08.js";import{T as mt}from"../chunks/Tip.b09c67cf.js";import{H as m}from"../chunks/Heading.8660bd0e.js";function St(ee){let u;return{c(){u=gt(`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=ht(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,T){a(S,u,T)},d(S){S&&o(u)}}}function bt(ee){let u,S,T,te,$,oe,w,Ie=`<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.`,ae,y,Ye=`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.`,le,E,ne,L,De="You can deploy Label Studio on Spaces with just a few clicks:",ie,b,ke='<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-to-spaces-lg.svg"/>',se,C,Be="Spaces requires you to define:",re,A,ze=`<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>`,ue,v,de,R,je=`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.`,pe,_,ce,O,Ke=`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.`,fe,x,ge,P,qe=`To make your Space production-ready, you will need to make three configuration
changes:`,he,M,We="<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>",me,H,Se,U,Fe=`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>.`,be,G,Ze=`<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,Je=`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,$e,Y,Qe=`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.`,we,D,Ve=`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.`,ye,k,Xe=`<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>`,Ee,B,et=`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.`,Le,z,Ce,j,tt=`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.`,Ae,K,ve,q,ot="<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,Oe,F,at="<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>",xe,Z,Pe,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>",Me,Q,He,V,nt=`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>.`,Ue,X,Ge;return $=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 mt({props:{warning:!0,$$slots:{default:[St]},$$scope:{ctx:ee}}}),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"}}),{c(){u=i("meta"),S=l(),T=i("p"),te=l(),d($.$$.fragment),oe=l(),w=i("p"),w.innerHTML=Ie,ae=l(),y=i("p"),y.textContent=Ye,le=l(),d(E.$$.fragment),ne=l(),L=i("p"),L.textContent=De,ie=l(),b=i("a"),b.innerHTML=ke,se=l(),C=i("p"),C.textContent=Be,re=l(),A=i("ul"),A.innerHTML=ze,ue=l(),d(v.$$.fragment),de=l(),R=i("p"),R.textContent=je,pe=l(),d(_.$$.fragment),ce=l(),O=i("p"),O.innerHTML=Ke,fe=l(),d(x.$$.fragment),ge=l(),P=i("p"),P.textContent=qe,he=l(),M=i("ul"),M.innerHTML=We,me=l(),d(H.$$.fragment),Se=l(),U=i("p"),U.innerHTML=Fe,be=l(),G=i("ul"),G.innerHTML=Ze,_e=l(),N=i("p"),N.innerHTML=Je,Te=l(),d(I.$$.fragment),$e=l(),Y=i("p"),Y.innerHTML=Qe,we=l(),D=i("p"),D.textContent=Ve,ye=l(),k=i("ul"),k.innerHTML=Xe,Ee=l(),B=i("p"),B.textContent=et,Le=l(),d(z.$$.fragment),Ce=l(),j=i("p"),j.innerHTML=tt,Ae=l(),d(K.$$.fragment),ve=l(),q=i("ul"),q.innerHTML=ot,Re=l(),d(W.$$.fragment),Oe=l(),F=i("ul"),F.innerHTML=at,xe=l(),d(Z.$$.fragment),Pe=l(),J=i("ul"),J.innerHTML=lt,Me=l(),d(Q.$$.fragment),He=l(),V=i("p"),V.innerHTML=nt,Ue=l(),X=i("p"),this.h()},l(e){const t=ct("svelte-u9bgzb",document.head);u=s(t,"META",{name:!0,content:!0}),t.forEach(o),S=n(e),T=s(e,"P",{}),st(T).forEach(o),te=n(e),p($.$$.fragment,e),oe=n(e),w=s(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-1rv0u62"&&(w.innerHTML=Ie),ae=n(e),y=s(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-hmjd3t"&&(y.textContent=Ye),le=n(e),p(E.$$.fragment,e),ne=n(e),L=s(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1wl7hvq"&&(L.textContent=De),ie=n(e),b=s(e,"A",{href:!0,"data-svelte-h":!0}),r(b)!=="svelte-q39mm4"&&(b.innerHTML=ke),se=n(e),C=s(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-zf4u24"&&(C.textContent=Be),re=n(e),A=s(e,"UL",{"data-svelte-h":!0}),r(A)!=="svelte-s4n4yw"&&(A.innerHTML=ze),ue=n(e),p(v.$$.fragment,e),de=n(e),R=s(e,"P",{"data-svelte-h":!0}),r(R)!=="svelte-8oph0w"&&(R.textContent=je),pe=n(e),p(_.$$.fragment,e),ce=n(e),O=s(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-19ntq6s"&&(O.innerHTML=Ke),fe=n(e),p(x.$$.fragment,e),ge=n(e),P=s(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-1uy07io"&&(P.textContent=qe),he=n(e),M=s(e,"UL",{"data-svelte-h":!0}),r(M)!=="svelte-b6pxba"&&(M.innerHTML=We),me=n(e),p(H.$$.fragment,e),Se=n(e),U=s(e,"P",{"data-svelte-h":!0}),r(U)!=="svelte-1wtsf11"&&(U.innerHTML=Fe),be=n(e),G=s(e,"UL",{"data-svelte-h":!0}),r(G)!=="svelte-1nfznj0"&&(G.innerHTML=Ze),_e=n(e),N=s(e,"P",{"data-svelte-h":!0}),r(N)!=="svelte-2s6qhr"&&(N.innerHTML=Je),Te=n(e),p(I.$$.fragment,e),$e=n(e),Y=s(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-grmueg"&&(Y.innerHTML=Qe),we=n(e),D=s(e,"P",{"data-svelte-h":!0}),r(D)!=="svelte-1wk5r67"&&(D.textContent=Ve),ye=n(e),k=s(e,"UL",{"data-svelte-h":!0}),r(k)!=="svelte-2i1l6o"&&(k.innerHTML=Xe),Ee=n(e),B=s(e,"P",{"data-svelte-h":!0}),r(B)!=="svelte-r9lm89"&&(B.textContent=et),Le=n(e),p(z.$$.fragment,e),Ce=n(e),j=s(e,"P",{"data-svelte-h":!0}),r(j)!=="svelte-1mq56yw"&&(j.innerHTML=tt),Ae=n(e),p(K.$$.fragment,e),ve=n(e),q=s(e,"UL",{"data-svelte-h":!0}),r(q)!=="svelte-dhekiv"&&(q.innerHTML=ot),Re=n(e),p(W.$$.fragment,e),Oe=n(e),F=s(e,"UL",{"data-svelte-h":!0}),r(F)!=="svelte-1yacqm5"&&(F.innerHTML=at),xe=n(e),p(Z.$$.fragment,e),Pe=n(e),J=s(e,"UL",{"data-svelte-h":!0}),r(J)!=="svelte-1m1d2oc"&&(J.innerHTML=lt),Me=n(e),p(Q.$$.fragment,e),He=n(e),V=s(e,"P",{"data-svelte-h":!0}),r(V)!=="svelte-1u6m1vl"&&(V.innerHTML=nt),Ue=n(e),X=s(e,"P",{}),st(X).forEach(o),this.h()},h(){Ne(u,"name","hf:doc:metadata"),Ne(u,"content",_t),Ne(b,"href","https://huggingface.co/new-space?template=LabelStudio/LabelStudio")},m(e,t){ft(document.head,u),a(e,S,t),a(e,T,t),a(e,te,t),c($,e,t),a(e,oe,t),a(e,w,t),a(e,ae,t),a(e,y,t),a(e,le,t),c(E,e,t),a(e,ne,t),a(e,L,t),a(e,ie,t),a(e,b,t),a(e,se,t),a(e,C,t),a(e,re,t),a(e,A,t),a(e,ue,t),c(v,e,t),a(e,de,t),a(e,R,t),a(e,pe,t),c(_,e,t),a(e,ce,t),a(e,O,t),a(e,fe,t),c(x,e,t),a(e,ge,t),a(e,P,t),a(e,he,t),a(e,M,t),a(e,me,t),c(H,e,t),a(e,Se,t),a(e,U,t),a(e,be,t),a(e,G,t),a(e,_e,t),a(e,N,t),a(e,Te,t),c(I,e,t),a(e,$e,t),a(e,Y,t),a(e,we,t),a(e,D,t),a(e,ye,t),a(e,k,t),a(e,Ee,t),a(e,B,t),a(e,Le,t),c(z,e,t),a(e,Ce,t),a(e,j,t),a(e,Ae,t),c(K,e,t),a(e,ve,t),a(e,q,t),a(e,Re,t),c(W,e,t),a(e,Oe,t),a(e,F,t),a(e,xe,t),c(Z,e,t),a(e,Pe,t),a(e,J,t),a(e,Me,t),c(Q,e,t),a(e,He,t),a(e,V,t),a(e,Ue,t),a(e,X,t),Ge=!0},p(e,[t]){const it={};t&2&&(it.$$scope={dirty:t,ctx:e}),_.$set(it)},i(e){Ge||(f($.$$.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),Ge=!0)},o(e){g($.$$.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),Ge=!1},d(e){e&&(o(S),o(T),o(te),o(oe),o(w),o(ae),o(y),o(le),o(ne),o(L),o(ie),o(b),o(se),o(C),o(re),o(A),o(ue),o(de),o(R),o(pe),o(ce),o(O),o(fe),o(ge),o(P),o(he),o(M),o(me),o(Se),o(U),o(be),o(G),o(_e),o(N),o(Te),o($e),o(Y),o(we),o(D),o(ye),o(k),o(Ee),o(B),o(Le),o(Ce),o(j),o(Ae),o(ve),o(q),o(Re),o(Oe),o(F),o(xe),o(Pe),o(J),o(Me),o(He),o(V),o(Ue),o(X)),o(u),h($,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)}}}const _t='{"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 Tt(ee){return ut(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Lt extends dt{constructor(u){super(),pt(this,u,Tt,bt,rt,{})}}export{Lt as component};
