import{S as Ul,i as Jl,s as Pl,e as a,k as i,w as J,t as l,N as Nl,c as s,d as o,m as d,a as r,x as P,h as n,b as f,P as Ae,G as e,g as h,y as N,L as Zl,q as Z,o as R,B as z,v as Rl}from"../chunks/vendor-hf-doc-builder.js";import{I as Qt}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as Po}from"../chunks/CodeBlock-hf-doc-builder.js";function zl(sr){let j,Ft,q,H,Se,ne,No,Ie,Zo,Kt,$,Ro,Ue,zo,Ho,Je,Wo,Yo,eo,W,Vo,Y,Pe,Xo,Lo,Qo,to,ie,oo,ye,Fo,ao,de,so,be,Ko,ro,p,ea,Ne,ta,oa,Ze,aa,sa,V,ra,Re,la,na,ze,ia,da,lo,O,X,He,ce,ca,We,ha,no,u,fa,Ye,ua,pa,Ve,ma,va,Xe,ga,_a,Le,Ea,ya,Qe,ba,wa,io,he,co,B,we,rr,Ta,Te,lr,ho,k,$a,Fe,ka,Da,$e,Ma,xa,fo,G,L,Ke,fe,Ca,et,ja,uo,Q,qa,tt,Oa,Ba,po,A,ke,nr,Ga,De,ir,mo,Me,Aa,vo,F,ot,_,at,Sa,Ia,st,Ua,Ja,rt,Pa,Na,lt,Za,Ra,v,E,nt,it,za,Ha,dt,ct,Wa,Ya,ht,Va,Xa,ft,ut,La,Qa,y,pt,mt,Fa,Ka,vt,gt,es,ts,_t,os,as,Et,yt,ss,rs,b,bt,wt,ls,ns,Tt,$t,is,ds,kt,cs,hs,Dt,Mt,fs,us,w,xt,Ct,ps,ms,jt,qt,vs,gs,ue,_s,Ot,Es,ys,bs,pe,Bt,ws,Ts,Gt,$s,ks,T,At,St,Ds,Ms,It,Ut,xs,Cs,Jt,js,qs,me,Pt,Os,Bs,Nt,Gs,go,m,As,Zt,Ss,Is,Rt,Us,Js,ve,Ps,Ns,zt,Zs,Rs,_o,S,K,Ht,ge,zs,Wt,Hs,Eo,xe,Ws,yo,Ce,Ys,bo,I,je,dr,Vs,qe,cr,wo,U,ee,Yt,_e,Xs,Vt,Ls,To,D,Qs,Xt,Fs,Ks,Lt,er,tr,$o,Ee,ko;return ne=new Qt({}),ie=new Po({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login"}}),de=new Po({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login
notebook_login()`}}),ce=new Qt({}),he=new Po({props:{code:"LS0tJTBBZXh0cmFfZ2F0ZWRfcHJvbXB0JTNBJTIwJTIyWW91JTIwYWdyZWUlMjB0byUyMG5vdCUyMHVzZSUyMHRoZSUyMG1vZGVsJTIwdG8lMjBjb25kdWN0JTIwZXhwZXJpbWVudHMlMjB0aGF0JTIwY2F1c2UlMjBoYXJtJTIwdG8lMjBodW1hbiUyMHN1YmplY3RzLiUyMiUwQWV4dHJhX2dhdGVkX2ZpZWxkcyUzQSUwQSUyMENvbXBhbnklM0ElMjB0ZXh0JTBBJTIwQ291bnRyeSUzQSUyMHRleHQlMEElMjBJJTIwYWdyZWUlMjB0byUyMHVzZSUyMHRoaXMlMjBtb2RlbCUyMGZvciUyMG5vbi1jb21tZXJjaWFsJTIwdXNlJTIwT05MWSUzQSUyMGNoZWNrYm94JTBBLS0t",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">extra_gated_prompt:</span> <span class="hljs-string">&quot;You agree to not use the model to conduct experiments that cause harm to human subjects.&quot;</span>
<span class="hljs-attr">extra_gated_fields:</span>
 <span class="hljs-attr">Company:</span> <span class="hljs-string">text</span>
 <span class="hljs-attr">Country:</span> <span class="hljs-string">text</span>
 <span class="hljs-attr">I agree to use this model for non-commercial use ONLY:</span> <span class="hljs-string">checkbox</span>
<span class="hljs-meta">---</span>`}}),fe=new Qt({}),ge=new Qt({}),_e=new Qt({}),Ee=new Po({props:{code:"LS0tJTBBZXh0cmFfZ2F0ZWRfaGVhZGluZyUzQSUyMCUyMkFja25vd2xlZGdlJTIwbGljZW5zZSUyMHRvJTIwYWNjZXB0JTIwdGhlJTIwcmVwb3NpdG9yeSUyMiUwQWV4dHJhX2dhdGVkX2J1dHRvbl9jb250ZW50JTNBJTIwJTIyQWNrbm93bGVkZ2UlMjBsaWNlbnNlJTIyJTBBLS0t",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">extra_gated_heading:</span> <span class="hljs-string">&quot;Acknowledge license to accept the repository&quot;</span>
<span class="hljs-attr">extra_gated_button_content:</span> <span class="hljs-string">&quot;Acknowledge license&quot;</span>
<span class="hljs-meta">---</span>`}}),{c(){j=a("meta"),Ft=i(),q=a("h1"),H=a("a"),Se=a("span"),J(ne.$$.fragment),No=i(),Ie=a("span"),Zo=l("Gated models"),Kt=i(),$=a("p"),Ro=l("To give model creators more control over how their models are used, the Hub allows users to enable "),Ue=a("strong"),zo=l("User Access requests"),Ho=l(" through a model\u2019s "),Je=a("strong"),Wo=l("Settings"),Yo=l(` tab.
Enabling this setting requires users to agree to share their contact information and accept the model owners\u2019 terms and conditions in order to access the model.
The contact information is stored in a database, and model owners are able to download a copy of the user access report.`),eo=i(),W=a("p"),Vo=l("Note that to download a gated model you\u2019ll need to be authenticated. You can log in by installing the "),Y=a("a"),Pe=a("code"),Xo=l("huggingface_hub"),Lo=l(" client library"),Qo=l(" and running the following in your terminal:"),to=i(),J(ie.$$.fragment),oo=i(),ye=a("p"),Fo=l("If you\u2019re using a Jupyter or Colaboratory notebook, log in with the following Python command"),ao=i(),J(de.$$.fragment),so=i(),be=a("p"),Ko=l("Then, ensure that your library uses the token. This is now the case by default in huggingface-maintained libraries."),ro=i(),p=a("p"),ea=l("However, on older versions of libraries, for example if using \u{1F917} Transformers with a version of "),Ne=a("code"),ta=l("huggingface_hub"),oa=l(" older than "),Ze=a("code"),aa=l("v0.10"),sa=i(),V=a("a"),ra=l("you\u2019ll need to pass "),Re=a("code"),la=l("use_auth_token=True"),na=l(" when calling "),ze=a("code"),ia=l(".from_pretrained()"),da=l("."),lo=i(),O=a("h2"),X=a("a"),He=a("span"),J(ce.$$.fragment),ca=i(),We=a("span"),ha=l("Modifying the prompt"),no=i(),u=a("p"),fa=l("The User Access request dialog can be modified to include additional text and checkbox fields in the prompt. To do this, add a YAML section to the model\u2019s "),Ye=a("code"),ua=l("README.md"),pa=l(" file (create one if it does not already exist) and add an "),Ve=a("code"),ma=l("extra_gated_fields"),va=l(" property. Within this property, you\u2019ll be able to add as many custom fields as you like and whether they are a "),Xe=a("code"),ga=l("text"),_a=l(" or "),Le=a("code"),Ea=l("checkbox"),ya=l(" field. An "),Qe=a("code"),ba=l("extra_gated_prompt"),wa=l(" property can also be included to add a customized text message."),io=i(),J(he.$$.fragment),co=i(),B=a("div"),we=a("img"),Ta=i(),Te=a("img"),ho=i(),k=a("p"),$a=l("The "),Fe=a("code"),ka=l("README.md"),Da=l(" file for a model is called a "),$e=a("a"),Ma=l("model Card"),xa=l(". Visit the documentation to learn more about how to use it and to see the properties that you can configure."),fo=i(),G=a("h2"),L=a("a"),Ke=a("span"),J(fe.$$.fragment),Ca=i(),et=a("span"),ja=l("Manual approval"),uo=i(),Q=a("p"),qa=l(`By default, requests to access the model are automatically accepted.
Model authors can set the approval mode to \u201CManual reviews\u201D from the model\u2019s `),tt=a("strong"),Oa=l("Settings"),Ba=l(` tab.
Doing so enforces that each access request will be manually reviewed and approved by the model authors.
Only users whose access requests have been approved will be able to access the model\u2019s content.`),po=i(),A=a("div"),ke=a("img"),Ga=i(),De=a("img"),mo=i(),Me=a("p"),Aa=l("You can automate the approval of access requests with the following API:"),vo=i(),F=a("table"),ot=a("thead"),_=a("tr"),at=a("th"),Sa=l("Method"),Ia=i(),st=a("th"),Ua=l("URI"),Ja=i(),rt=a("th"),Pa=l("Description"),Na=i(),lt=a("th"),Za=l("Payload"),Ra=i(),v=a("tbody"),E=a("tr"),nt=a("td"),it=a("code"),za=l("GET"),Ha=i(),dt=a("td"),ct=a("code"),Wa=l("/api/models/{repo_id}/user-access-request/pending"),Ya=i(),ht=a("td"),Va=l("Retrieve the list of pending access requests for the given model."),Xa=i(),ft=a("td"),ut=a("code"),La=l('headers = { "authorization" : "Bearer $token" }'),Qa=i(),y=a("tr"),pt=a("td"),mt=a("code"),Fa=l("GET"),Ka=i(),vt=a("td"),gt=a("code"),es=l("/api/models/{repo_id}/user-access-request/accepted"),ts=i(),_t=a("td"),os=l("Retrieve the list of accepted access requests for the given model."),as=i(),Et=a("td"),yt=a("code"),ss=l('headers = { "authorization" : "Bearer $token" }'),rs=i(),b=a("tr"),bt=a("td"),wt=a("code"),ls=l("GET"),ns=i(),Tt=a("td"),$t=a("code"),is=l("/api/models/{repo_id}/user-access-request/rejected"),ds=i(),kt=a("td"),cs=l("Retrieve the list of rejected access requests for the given model"),hs=i(),Dt=a("td"),Mt=a("code"),fs=l('headers = { "authorization" : "Bearer $token" }'),us=i(),w=a("tr"),xt=a("td"),Ct=a("code"),ps=l("POST"),ms=i(),jt=a("td"),qt=a("code"),vs=l("/api/models/{repo_id}/user-access-request/handle"),gs=i(),ue=a("td"),_s=l("Change the status of a given access request to "),Ot=a("code"),Es=l("status"),ys=l("."),bs=i(),pe=a("td"),Bt=a("code"),ws=l('headers = { "authorization" : "Bearer $token" }'),Ts=i(),Gt=a("code"),$s=l('json = { "status": "accepted" | "rejected" | "pending", "user": "username" }'),ks=i(),T=a("tr"),At=a("td"),St=a("code"),Ds=l("POST"),Ms=i(),It=a("td"),Ut=a("code"),xs=l("/api/models/{repo_id}/user-access-request/grant"),Cs=i(),Jt=a("td"),js=l("Allow a specific user to access your repo."),qs=i(),me=a("td"),Pt=a("code"),Os=l('headers = { "authorization" : "Bearer $token" }'),Bs=i(),Nt=a("code"),Gs=l('json = { "user": "username" }'),go=i(),m=a("p"),As=l("The base URL for the HTTP endpoints above is "),Zt=a("code"),Ss=l("https://huggingface.co"),Is=l(". The "),Rt=a("code"),Us=l("$token"),Js=l(" to pass as a bearer token can be generated from "),ve=a("a"),Ps=l("your user settings"),Ns=l(". It must have "),zt=a("code"),Zs=l("write"),Rs=l(" access to the gated repository."),_o=i(),S=a("h3"),K=a("a"),Ht=a("span"),J(ge.$$.fragment),zs=i(),Wt=a("span"),Hs=l("Notifications settings"),Eo=i(),xe=a("p"),Ws=l(`By default, notifications for new pending access requests are sent once a day via email.
When the repo lives in an organization, those emails are sent to the first 5 admins of the organization.`),yo=i(),Ce=a("p"),Ys=l(`You can customize the way you receive those notifications from the gated model\u2019s settings page.
You can choose whether to receive notifications for new pending access requests in bulk once a day or in real-time.
You can also set a custom email to send those notifications to.`),bo=i(),I=a("div"),je=a("img"),Vs=i(),qe=a("img"),wo=i(),U=a("h2"),ee=a("a"),Yt=a("span"),J(_e.$$.fragment),Xs=i(),Vt=a("span"),Ls=l("Additional Customization"),To=i(),D=a("p"),Qs=l("In some cases, you might also want to modify the text in the heading of the gate as well as the text in the button. For those use cases you can modify "),Xt=a("code"),Fs=l("extra_gated_heading"),Ks=l(" and "),Lt=a("code"),er=l("extra_gated_button_content"),tr=l("."),$o=i(),J(Ee.$$.fragment),this.h()},l(t){const c=Nl('[data-svelte="svelte-1phssyn"]',document.head);j=s(c,"META",{name:!0,content:!0}),c.forEach(o),Ft=d(t),q=s(t,"H1",{class:!0});var Do=r(q);H=s(Do,"A",{id:!0,class:!0,href:!0});var hr=r(H);Se=s(hr,"SPAN",{});var fr=r(Se);P(ne.$$.fragment,fr),fr.forEach(o),hr.forEach(o),No=d(Do),Ie=s(Do,"SPAN",{});var ur=r(Ie);Zo=n(ur,"Gated models"),ur.forEach(o),Do.forEach(o),Kt=d(t),$=s(t,"P",{});var Oe=r($);Ro=n(Oe,"To give model creators more control over how their models are used, the Hub allows users to enable "),Ue=s(Oe,"STRONG",{});var pr=r(Ue);zo=n(pr,"User Access requests"),pr.forEach(o),Ho=n(Oe," through a model\u2019s "),Je=s(Oe,"STRONG",{});var mr=r(Je);Wo=n(mr,"Settings"),mr.forEach(o),Yo=n(Oe,` tab.
Enabling this setting requires users to agree to share their contact information and accept the model owners\u2019 terms and conditions in order to access the model.
The contact information is stored in a database, and model owners are able to download a copy of the user access report.`),Oe.forEach(o),eo=d(t),W=s(t,"P",{});var Mo=r(W);Vo=n(Mo,"Note that to download a gated model you\u2019ll need to be authenticated. You can log in by installing the "),Y=s(Mo,"A",{href:!0,rel:!0});var or=r(Y);Pe=s(or,"CODE",{});var vr=r(Pe);Xo=n(vr,"huggingface_hub"),vr.forEach(o),Lo=n(or," client library"),or.forEach(o),Qo=n(Mo," and running the following in your terminal:"),Mo.forEach(o),to=d(t),P(ie.$$.fragment,t),oo=d(t),ye=s(t,"P",{});var gr=r(ye);Fo=n(gr,"If you\u2019re using a Jupyter or Colaboratory notebook, log in with the following Python command"),gr.forEach(o),ao=d(t),P(de.$$.fragment,t),so=d(t),be=s(t,"P",{});var _r=r(be);Ko=n(_r,"Then, ensure that your library uses the token. This is now the case by default in huggingface-maintained libraries."),_r.forEach(o),ro=d(t),p=s(t,"P",{});var M=r(p);ea=n(M,"However, on older versions of libraries, for example if using \u{1F917} Transformers with a version of "),Ne=s(M,"CODE",{});var Er=r(Ne);ta=n(Er,"huggingface_hub"),Er.forEach(o),oa=n(M," older than "),Ze=s(M,"CODE",{});var yr=r(Ze);aa=n(yr,"v0.10"),yr.forEach(o),sa=d(M),V=s(M,"A",{href:!0,rel:!0});var ar=r(V);ra=n(ar,"you\u2019ll need to pass "),Re=s(ar,"CODE",{});var br=r(Re);la=n(br,"use_auth_token=True"),br.forEach(o),ar.forEach(o),na=n(M," when calling "),ze=s(M,"CODE",{});var wr=r(ze);ia=n(wr,".from_pretrained()"),wr.forEach(o),da=n(M,"."),M.forEach(o),lo=d(t),O=s(t,"H2",{class:!0});var xo=r(O);X=s(xo,"A",{id:!0,class:!0,href:!0});var Tr=r(X);He=s(Tr,"SPAN",{});var $r=r(He);P(ce.$$.fragment,$r),$r.forEach(o),Tr.forEach(o),ca=d(xo),We=s(xo,"SPAN",{});var kr=r(We);ha=n(kr,"Modifying the prompt"),kr.forEach(o),xo.forEach(o),no=d(t),u=s(t,"P",{});var g=r(u);fa=n(g,"The User Access request dialog can be modified to include additional text and checkbox fields in the prompt. To do this, add a YAML section to the model\u2019s "),Ye=s(g,"CODE",{});var Dr=r(Ye);ua=n(Dr,"README.md"),Dr.forEach(o),pa=n(g," file (create one if it does not already exist) and add an "),Ve=s(g,"CODE",{});var Mr=r(Ve);ma=n(Mr,"extra_gated_fields"),Mr.forEach(o),va=n(g," property. Within this property, you\u2019ll be able to add as many custom fields as you like and whether they are a "),Xe=s(g,"CODE",{});var xr=r(Xe);ga=n(xr,"text"),xr.forEach(o),_a=n(g," or "),Le=s(g,"CODE",{});var Cr=r(Le);Ea=n(Cr,"checkbox"),Cr.forEach(o),ya=n(g," field. An "),Qe=s(g,"CODE",{});var jr=r(Qe);ba=n(jr,"extra_gated_prompt"),jr.forEach(o),wa=n(g," property can also be included to add a customized text message."),g.forEach(o),io=d(t),P(he.$$.fragment,t),co=d(t),B=s(t,"DIV",{class:!0});var Co=r(B);we=s(Co,"IMG",{class:!0,src:!0}),Ta=d(Co),Te=s(Co,"IMG",{class:!0,src:!0}),Co.forEach(o),ho=d(t),k=s(t,"P",{});var Be=r(k);$a=n(Be,"The "),Fe=s(Be,"CODE",{});var qr=r(Fe);ka=n(qr,"README.md"),qr.forEach(o),Da=n(Be," file for a model is called a "),$e=s(Be,"A",{href:!0});var Or=r($e);Ma=n(Or,"model Card"),Or.forEach(o),xa=n(Be,". Visit the documentation to learn more about how to use it and to see the properties that you can configure."),Be.forEach(o),fo=d(t),G=s(t,"H2",{class:!0});var jo=r(G);L=s(jo,"A",{id:!0,class:!0,href:!0});var Br=r(L);Ke=s(Br,"SPAN",{});var Gr=r(Ke);P(fe.$$.fragment,Gr),Gr.forEach(o),Br.forEach(o),Ca=d(jo),et=s(jo,"SPAN",{});var Ar=r(et);ja=n(Ar,"Manual approval"),Ar.forEach(o),jo.forEach(o),uo=d(t),Q=s(t,"P",{});var qo=r(Q);qa=n(qo,`By default, requests to access the model are automatically accepted.
Model authors can set the approval mode to \u201CManual reviews\u201D from the model\u2019s `),tt=s(qo,"STRONG",{});var Sr=r(tt);Oa=n(Sr,"Settings"),Sr.forEach(o),Ba=n(qo,` tab.
Doing so enforces that each access request will be manually reviewed and approved by the model authors.
Only users whose access requests have been approved will be able to access the model\u2019s content.`),qo.forEach(o),po=d(t),A=s(t,"DIV",{class:!0});var Oo=r(A);ke=s(Oo,"IMG",{class:!0,src:!0}),Ga=d(Oo),De=s(Oo,"IMG",{class:!0,src:!0}),Oo.forEach(o),mo=d(t),Me=s(t,"P",{});var Ir=r(Me);Aa=n(Ir,"You can automate the approval of access requests with the following API:"),Ir.forEach(o),vo=d(t),F=s(t,"TABLE",{});var Bo=r(F);ot=s(Bo,"THEAD",{});var Ur=r(ot);_=s(Ur,"TR",{});var te=r(_);at=s(te,"TH",{});var Jr=r(at);Sa=n(Jr,"Method"),Jr.forEach(o),Ia=d(te),st=s(te,"TH",{});var Pr=r(st);Ua=n(Pr,"URI"),Pr.forEach(o),Ja=d(te),rt=s(te,"TH",{});var Nr=r(rt);Pa=n(Nr,"Description"),Nr.forEach(o),Na=d(te),lt=s(te,"TH",{});var Zr=r(lt);Za=n(Zr,"Payload"),Zr.forEach(o),te.forEach(o),Ur.forEach(o),Ra=d(Bo),v=s(Bo,"TBODY",{});var x=r(v);E=s(x,"TR",{});var oe=r(E);nt=s(oe,"TD",{});var Rr=r(nt);it=s(Rr,"CODE",{});var zr=r(it);za=n(zr,"GET"),zr.forEach(o),Rr.forEach(o),Ha=d(oe),dt=s(oe,"TD",{});var Hr=r(dt);ct=s(Hr,"CODE",{});var Wr=r(ct);Wa=n(Wr,"/api/models/{repo_id}/user-access-request/pending"),Wr.forEach(o),Hr.forEach(o),Ya=d(oe),ht=s(oe,"TD",{});var Yr=r(ht);Va=n(Yr,"Retrieve the list of pending access requests for the given model."),Yr.forEach(o),Xa=d(oe),ft=s(oe,"TD",{});var Vr=r(ft);ut=s(Vr,"CODE",{});var Xr=r(ut);La=n(Xr,'headers = { "authorization" : "Bearer $token" }'),Xr.forEach(o),Vr.forEach(o),oe.forEach(o),Qa=d(x),y=s(x,"TR",{});var ae=r(y);pt=s(ae,"TD",{});var Lr=r(pt);mt=s(Lr,"CODE",{});var Qr=r(mt);Fa=n(Qr,"GET"),Qr.forEach(o),Lr.forEach(o),Ka=d(ae),vt=s(ae,"TD",{});var Fr=r(vt);gt=s(Fr,"CODE",{});var Kr=r(gt);es=n(Kr,"/api/models/{repo_id}/user-access-request/accepted"),Kr.forEach(o),Fr.forEach(o),ts=d(ae),_t=s(ae,"TD",{});var el=r(_t);os=n(el,"Retrieve the list of accepted access requests for the given model."),el.forEach(o),as=d(ae),Et=s(ae,"TD",{});var tl=r(Et);yt=s(tl,"CODE",{});var ol=r(yt);ss=n(ol,'headers = { "authorization" : "Bearer $token" }'),ol.forEach(o),tl.forEach(o),ae.forEach(o),rs=d(x),b=s(x,"TR",{});var se=r(b);bt=s(se,"TD",{});var al=r(bt);wt=s(al,"CODE",{});var sl=r(wt);ls=n(sl,"GET"),sl.forEach(o),al.forEach(o),ns=d(se),Tt=s(se,"TD",{});var rl=r(Tt);$t=s(rl,"CODE",{});var ll=r($t);is=n(ll,"/api/models/{repo_id}/user-access-request/rejected"),ll.forEach(o),rl.forEach(o),ds=d(se),kt=s(se,"TD",{});var nl=r(kt);cs=n(nl,"Retrieve the list of rejected access requests for the given model"),nl.forEach(o),hs=d(se),Dt=s(se,"TD",{});var il=r(Dt);Mt=s(il,"CODE",{});var dl=r(Mt);fs=n(dl,'headers = { "authorization" : "Bearer $token" }'),dl.forEach(o),il.forEach(o),se.forEach(o),us=d(x),w=s(x,"TR",{});var re=r(w);xt=s(re,"TD",{});var cl=r(xt);Ct=s(cl,"CODE",{});var hl=r(Ct);ps=n(hl,"POST"),hl.forEach(o),cl.forEach(o),ms=d(re),jt=s(re,"TD",{});var fl=r(jt);qt=s(fl,"CODE",{});var ul=r(qt);vs=n(ul,"/api/models/{repo_id}/user-access-request/handle"),ul.forEach(o),fl.forEach(o),gs=d(re),ue=s(re,"TD",{});var Go=r(ue);_s=n(Go,"Change the status of a given access request to "),Ot=s(Go,"CODE",{});var pl=r(Ot);Es=n(pl,"status"),pl.forEach(o),ys=n(Go,"."),Go.forEach(o),bs=d(re),pe=s(re,"TD",{});var Ao=r(pe);Bt=s(Ao,"CODE",{});var ml=r(Bt);ws=n(ml,'headers = { "authorization" : "Bearer $token" }'),ml.forEach(o),Ts=d(Ao),Gt=s(Ao,"CODE",{});var vl=r(Gt);$s=n(vl,'json = { "status": "accepted" | "rejected" | "pending", "user": "username" }'),vl.forEach(o),Ao.forEach(o),re.forEach(o),ks=d(x),T=s(x,"TR",{});var le=r(T);At=s(le,"TD",{});var gl=r(At);St=s(gl,"CODE",{});var _l=r(St);Ds=n(_l,"POST"),_l.forEach(o),gl.forEach(o),Ms=d(le),It=s(le,"TD",{});var El=r(It);Ut=s(El,"CODE",{});var yl=r(Ut);xs=n(yl,"/api/models/{repo_id}/user-access-request/grant"),yl.forEach(o),El.forEach(o),Cs=d(le),Jt=s(le,"TD",{});var bl=r(Jt);js=n(bl,"Allow a specific user to access your repo."),bl.forEach(o),qs=d(le),me=s(le,"TD",{});var So=r(me);Pt=s(So,"CODE",{});var wl=r(Pt);Os=n(wl,'headers = { "authorization" : "Bearer $token" }'),wl.forEach(o),Bs=d(So),Nt=s(So,"CODE",{});var Tl=r(Nt);Gs=n(Tl,'json = { "user": "username" }'),Tl.forEach(o),So.forEach(o),le.forEach(o),x.forEach(o),Bo.forEach(o),go=d(t),m=s(t,"P",{});var C=r(m);As=n(C,"The base URL for the HTTP endpoints above is "),Zt=s(C,"CODE",{});var $l=r(Zt);Ss=n($l,"https://huggingface.co"),$l.forEach(o),Is=n(C,". The "),Rt=s(C,"CODE",{});var kl=r(Rt);Us=n(kl,"$token"),kl.forEach(o),Js=n(C," to pass as a bearer token can be generated from "),ve=s(C,"A",{href:!0,rel:!0});var Dl=r(ve);Ps=n(Dl,"your user settings"),Dl.forEach(o),Ns=n(C,". It must have "),zt=s(C,"CODE",{});var Ml=r(zt);Zs=n(Ml,"write"),Ml.forEach(o),Rs=n(C," access to the gated repository."),C.forEach(o),_o=d(t),S=s(t,"H3",{class:!0});var Io=r(S);K=s(Io,"A",{id:!0,class:!0,href:!0});var xl=r(K);Ht=s(xl,"SPAN",{});var Cl=r(Ht);P(ge.$$.fragment,Cl),Cl.forEach(o),xl.forEach(o),zs=d(Io),Wt=s(Io,"SPAN",{});var jl=r(Wt);Hs=n(jl,"Notifications settings"),jl.forEach(o),Io.forEach(o),Eo=d(t),xe=s(t,"P",{});var ql=r(xe);Ws=n(ql,`By default, notifications for new pending access requests are sent once a day via email.
When the repo lives in an organization, those emails are sent to the first 5 admins of the organization.`),ql.forEach(o),yo=d(t),Ce=s(t,"P",{});var Ol=r(Ce);Ys=n(Ol,`You can customize the way you receive those notifications from the gated model\u2019s settings page.
You can choose whether to receive notifications for new pending access requests in bulk once a day or in real-time.
You can also set a custom email to send those notifications to.`),Ol.forEach(o),bo=d(t),I=s(t,"DIV",{class:!0});var Uo=r(I);je=s(Uo,"IMG",{class:!0,src:!0}),Vs=d(Uo),qe=s(Uo,"IMG",{class:!0,src:!0}),Uo.forEach(o),wo=d(t),U=s(t,"H2",{class:!0});var Jo=r(U);ee=s(Jo,"A",{id:!0,class:!0,href:!0});var Bl=r(ee);Yt=s(Bl,"SPAN",{});var Gl=r(Yt);P(_e.$$.fragment,Gl),Gl.forEach(o),Bl.forEach(o),Xs=d(Jo),Vt=s(Jo,"SPAN",{});var Al=r(Vt);Ls=n(Al,"Additional Customization"),Al.forEach(o),Jo.forEach(o),To=d(t),D=s(t,"P",{});var Ge=r(D);Qs=n(Ge,"In some cases, you might also want to modify the text in the heading of the gate as well as the text in the button. For those use cases you can modify "),Xt=s(Ge,"CODE",{});var Sl=r(Xt);Fs=n(Sl,"extra_gated_heading"),Sl.forEach(o),Ks=n(Ge," and "),Lt=s(Ge,"CODE",{});var Il=r(Lt);er=n(Il,"extra_gated_button_content"),Il.forEach(o),tr=n(Ge,"."),Ge.forEach(o),$o=d(t),P(Ee.$$.fragment,t),this.h()},h(){f(j,"name","hf:doc:metadata"),f(j,"content",JSON.stringify(Hl)),f(H,"id","gated-models"),f(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(H,"href","#gated-models"),f(q,"class","relative group"),f(Y,"href","https://huggingface.co/docs/huggingface_hub/index"),f(Y,"rel","nofollow"),f(V,"href","https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained"),f(V,"rel","nofollow"),f(X,"id","modifying-the-prompt"),f(X,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(X,"href","#modifying-the-prompt"),f(O,"class","relative group"),f(we,"class","block dark:hidden"),Ae(we.src,rr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated.png")||f(we,"src",rr),f(Te,"class","hidden dark:block"),Ae(Te.src,lr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-dark.png")||f(Te,"src",lr),f(B,"class","flex justify-center"),f($e,"href","./model-cards"),f(L,"id","manual-approval"),f(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(L,"href","#manual-approval"),f(G,"class","relative group"),f(ke,"class","block dark:hidden"),Ae(ke.src,nr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-manual-approval.png")||f(ke,"src",nr),f(De,"class","hidden dark:block"),Ae(De.src,ir="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-manual-approval-dark.png")||f(De,"src",ir),f(A,"class","flex justify-center"),f(ve,"href","https://huggingface.co/settings/tokens"),f(ve,"rel","nofollow"),f(K,"id","notifications-settings"),f(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(K,"href","#notifications-settings"),f(S,"class","relative group"),f(je,"class","block dark:hidden"),Ae(je.src,dr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-notifications.png")||f(je,"src",dr),f(qe,"class","hidden dark:block"),Ae(qe.src,cr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-notifications-dark.png")||f(qe,"src",cr),f(I,"class","flex justify-center"),f(ee,"id","additional-customization"),f(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(ee,"href","#additional-customization"),f(U,"class","relative group")},m(t,c){e(document.head,j),h(t,Ft,c),h(t,q,c),e(q,H),e(H,Se),N(ne,Se,null),e(q,No),e(q,Ie),e(Ie,Zo),h(t,Kt,c),h(t,$,c),e($,Ro),e($,Ue),e(Ue,zo),e($,Ho),e($,Je),e(Je,Wo),e($,Yo),h(t,eo,c),h(t,W,c),e(W,Vo),e(W,Y),e(Y,Pe),e(Pe,Xo),e(Y,Lo),e(W,Qo),h(t,to,c),N(ie,t,c),h(t,oo,c),h(t,ye,c),e(ye,Fo),h(t,ao,c),N(de,t,c),h(t,so,c),h(t,be,c),e(be,Ko),h(t,ro,c),h(t,p,c),e(p,ea),e(p,Ne),e(Ne,ta),e(p,oa),e(p,Ze),e(Ze,aa),e(p,sa),e(p,V),e(V,ra),e(V,Re),e(Re,la),e(p,na),e(p,ze),e(ze,ia),e(p,da),h(t,lo,c),h(t,O,c),e(O,X),e(X,He),N(ce,He,null),e(O,ca),e(O,We),e(We,ha),h(t,no,c),h(t,u,c),e(u,fa),e(u,Ye),e(Ye,ua),e(u,pa),e(u,Ve),e(Ve,ma),e(u,va),e(u,Xe),e(Xe,ga),e(u,_a),e(u,Le),e(Le,Ea),e(u,ya),e(u,Qe),e(Qe,ba),e(u,wa),h(t,io,c),N(he,t,c),h(t,co,c),h(t,B,c),e(B,we),e(B,Ta),e(B,Te),h(t,ho,c),h(t,k,c),e(k,$a),e(k,Fe),e(Fe,ka),e(k,Da),e(k,$e),e($e,Ma),e(k,xa),h(t,fo,c),h(t,G,c),e(G,L),e(L,Ke),N(fe,Ke,null),e(G,Ca),e(G,et),e(et,ja),h(t,uo,c),h(t,Q,c),e(Q,qa),e(Q,tt),e(tt,Oa),e(Q,Ba),h(t,po,c),h(t,A,c),e(A,ke),e(A,Ga),e(A,De),h(t,mo,c),h(t,Me,c),e(Me,Aa),h(t,vo,c),h(t,F,c),e(F,ot),e(ot,_),e(_,at),e(at,Sa),e(_,Ia),e(_,st),e(st,Ua),e(_,Ja),e(_,rt),e(rt,Pa),e(_,Na),e(_,lt),e(lt,Za),e(F,Ra),e(F,v),e(v,E),e(E,nt),e(nt,it),e(it,za),e(E,Ha),e(E,dt),e(dt,ct),e(ct,Wa),e(E,Ya),e(E,ht),e(ht,Va),e(E,Xa),e(E,ft),e(ft,ut),e(ut,La),e(v,Qa),e(v,y),e(y,pt),e(pt,mt),e(mt,Fa),e(y,Ka),e(y,vt),e(vt,gt),e(gt,es),e(y,ts),e(y,_t),e(_t,os),e(y,as),e(y,Et),e(Et,yt),e(yt,ss),e(v,rs),e(v,b),e(b,bt),e(bt,wt),e(wt,ls),e(b,ns),e(b,Tt),e(Tt,$t),e($t,is),e(b,ds),e(b,kt),e(kt,cs),e(b,hs),e(b,Dt),e(Dt,Mt),e(Mt,fs),e(v,us),e(v,w),e(w,xt),e(xt,Ct),e(Ct,ps),e(w,ms),e(w,jt),e(jt,qt),e(qt,vs),e(w,gs),e(w,ue),e(ue,_s),e(ue,Ot),e(Ot,Es),e(ue,ys),e(w,bs),e(w,pe),e(pe,Bt),e(Bt,ws),e(pe,Ts),e(pe,Gt),e(Gt,$s),e(v,ks),e(v,T),e(T,At),e(At,St),e(St,Ds),e(T,Ms),e(T,It),e(It,Ut),e(Ut,xs),e(T,Cs),e(T,Jt),e(Jt,js),e(T,qs),e(T,me),e(me,Pt),e(Pt,Os),e(me,Bs),e(me,Nt),e(Nt,Gs),h(t,go,c),h(t,m,c),e(m,As),e(m,Zt),e(Zt,Ss),e(m,Is),e(m,Rt),e(Rt,Us),e(m,Js),e(m,ve),e(ve,Ps),e(m,Ns),e(m,zt),e(zt,Zs),e(m,Rs),h(t,_o,c),h(t,S,c),e(S,K),e(K,Ht),N(ge,Ht,null),e(S,zs),e(S,Wt),e(Wt,Hs),h(t,Eo,c),h(t,xe,c),e(xe,Ws),h(t,yo,c),h(t,Ce,c),e(Ce,Ys),h(t,bo,c),h(t,I,c),e(I,je),e(I,Vs),e(I,qe),h(t,wo,c),h(t,U,c),e(U,ee),e(ee,Yt),N(_e,Yt,null),e(U,Xs),e(U,Vt),e(Vt,Ls),h(t,To,c),h(t,D,c),e(D,Qs),e(D,Xt),e(Xt,Fs),e(D,Ks),e(D,Lt),e(Lt,er),e(D,tr),h(t,$o,c),N(Ee,t,c),ko=!0},p:Zl,i(t){ko||(Z(ne.$$.fragment,t),Z(ie.$$.fragment,t),Z(de.$$.fragment,t),Z(ce.$$.fragment,t),Z(he.$$.fragment,t),Z(fe.$$.fragment,t),Z(ge.$$.fragment,t),Z(_e.$$.fragment,t),Z(Ee.$$.fragment,t),ko=!0)},o(t){R(ne.$$.fragment,t),R(ie.$$.fragment,t),R(de.$$.fragment,t),R(ce.$$.fragment,t),R(he.$$.fragment,t),R(fe.$$.fragment,t),R(ge.$$.fragment,t),R(_e.$$.fragment,t),R(Ee.$$.fragment,t),ko=!1},d(t){o(j),t&&o(Ft),t&&o(q),z(ne),t&&o(Kt),t&&o($),t&&o(eo),t&&o(W),t&&o(to),z(ie,t),t&&o(oo),t&&o(ye),t&&o(ao),z(de,t),t&&o(so),t&&o(be),t&&o(ro),t&&o(p),t&&o(lo),t&&o(O),z(ce),t&&o(no),t&&o(u),t&&o(io),z(he,t),t&&o(co),t&&o(B),t&&o(ho),t&&o(k),t&&o(fo),t&&o(G),z(fe),t&&o(uo),t&&o(Q),t&&o(po),t&&o(A),t&&o(mo),t&&o(Me),t&&o(vo),t&&o(F),t&&o(go),t&&o(m),t&&o(_o),t&&o(S),z(ge),t&&o(Eo),t&&o(xe),t&&o(yo),t&&o(Ce),t&&o(bo),t&&o(I),t&&o(wo),t&&o(U),z(_e),t&&o(To),t&&o(D),t&&o($o),z(Ee,t)}}}const Hl={local:"gated-models",sections:[{local:"modifying-the-prompt",title:"Modifying the prompt "},{local:"manual-approval",sections:[{local:"notifications-settings",title:"Notifications settings"}],title:"Manual approval"},{local:"additional-customization",title:"Additional Customization"}],title:"Gated models"};function Wl(sr){return Rl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ll extends Ul{constructor(j){super();Jl(this,j,Wl,zl,Pl,{})}}export{Ll as default,Hl as metadata};
