import{s as Re,n as We,o as Je}from"../chunks/scheduler.0cf4ef2e.js";import{S as Xe,i as Ye,e as g,s as o,c as p,h as Ze,a as l,d as n,b as i,f as Y,g as m,j as c,k as z,l as a,m as r,n as _,t as b,o as k,p as $}from"../chunks/index.abc433bf.js";import{C as et,H as te,E as tt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c5e6f579.js";import{D as be}from"../chunks/Docstring.d25cce65.js";function nt(Pe){let v,ne,Z,oe,y,ie,T,ae,L,De="<code>huggingface_hub</code> 라이브러리를 사용하면 사용자의 기기를 Hub에 프로그래밍적으로 로그인/로그아웃할 수 있습니다.",re,C,qe='인증에 대한 자세한 내용은 <a href="../quick-start#authentication">이 섹션</a>을 확인하세요.',ge,H,le,s,M,ke,N,Fe="Login the machine to access the Hub.",$e,U,Ve=`The <code>token</code> is persisted in cache and set as a git credential. Once done, the machine
is logged in and the access token will be available across all <code>huggingface_hub</code>
components. If <code>token</code> is not provided, it will be prompted to the user either with
a widget (in a notebook) or via the terminal.`,ve,j,Oe=`To log in from outside of a script, one can also use <code>hf auth login</code> which is
a cli command that wraps <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login">login()</a>.`,xe,S,ze=`<p>[!TIP][login()](/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login) is a drop-in replacement method for <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.notebook_login">notebook_login()</a> as it wraps and
extends its capabilities.</p>`,we,E,Ne=`<p>When the token is not passed, <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login">login()</a> will automatically detect if the script runs
in a notebook or not. However, this detection might not be accurate due to the
variety of notebooks that exists nowadays. If that is the case, you can always force
the UI by using <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.notebook_login">notebook_login()</a> or <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.interpreter_login">interpreter_login()</a>.</p>`,se,I,ce,u,P,ye,B,Ue="Displays a prompt to log in to the HF website and store the token.",Te,K,je=`This is equivalent to <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login">login()</a> without passing a token when not run in a notebook.
<a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.interpreter_login">interpreter_login()</a> is useful if you want to force the use of the terminal prompt
instead of a notebook widget.`,Le,Q,Se='For more details, see <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login">login()</a>.',ue,D,de,d,q,Ce,A,Be="Displays a widget to log in to the HF website and store the token.",He,G,Ke=`This is equivalent to <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login">login()</a> without passing a token when run in a notebook.
<a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.notebook_login">notebook_login()</a> is useful if you want to force the use of the notebook widget
instead of a prompt in the terminal.`,Me,R,Qe='For more details, see <a href="/docs/huggingface_hub/main/ko/package_reference/login#huggingface_hub.login">login()</a>.',he,F,fe,f,V,Ee,W,Ae="Logout the machine from the Hub.",Ie,J,Ge="Token is deleted from the machine and removed from git credential.",pe,O,me,ee,_e;return y=new et({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=new te({props:{title:"로그인 및 로그아웃",local:"login-and-logout",headingTag:"h1"}}),H=new te({props:{title:"로그인",local:"login ][ huggingface_hub.login",headingTag:"h2"}}),M=new be({props:{name:"huggingface_hub.login",anchor:"huggingface_hub.login",parameters:[{name:"token",val:": typing.Optional[str] = None"},{name:"add_to_git_credential",val:": bool = False"},{name:"skip_if_logged_in",val:": bool = False"}],parametersDescription:[{anchor:"huggingface_hub.login.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
User access token to generate from <a href="https://huggingface.co/settings/token" rel="nofollow">https://huggingface.co/settings/token</a>.`,name:"token"},{anchor:"huggingface_hub.login.add_to_git_credential",description:`<strong>add_to_git_credential</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, token will be set as git credential. If no git credential helper
is configured, a warning will be displayed to the user. If <code>token</code> is <code>None</code>,
the value of <code>add_to_git_credential</code> is ignored and will be prompted again
to the end user.`,name:"add_to_git_credential"},{anchor:"huggingface_hub.login.skip_if_logged_in",description:`<strong>skip_if_logged_in</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, do not prompt for token if user is already logged in.`,name:"skip_if_logged_in"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_login.py#L59",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><a
  href="https://docs.python.org/3/library/exceptions.html#ValueError"
  rel="nofollow"
><code>ValueError</code></a> —
If an organization token is passed. Only personal account tokens are valid
to log in.</li>
<li><a
  href="https://docs.python.org/3/library/exceptions.html#ValueError"
  rel="nofollow"
><code>ValueError</code></a> —
If token is invalid.</li>
<li><a
  href="https://docs.python.org/3/library/exceptions.html#ImportError"
  rel="nofollow"
><code>ImportError</code></a> —
If running in a notebook but <code>ipywidgets</code> is not installed.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code> or <code>ImportError</code></p>
`}}),I=new te({props:{title:"인터프리터_로그인",local:"interpreter_login ][ huggingface_hub.interpreter_login",headingTag:"h2"}}),P=new be({props:{name:"huggingface_hub.interpreter_login",anchor:"huggingface_hub.interpreter_login",parameters:[{name:"skip_if_logged_in",val:": bool = False"}],parametersDescription:[{anchor:"huggingface_hub.interpreter_login.skip_if_logged_in",description:`<strong>skip_if_logged_in</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, do not prompt for token if user is already logged in.`,name:"skip_if_logged_in"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_login.py#L231"}}),D=new te({props:{title:"노트북_로그인",local:"notebook_login ][ huggingface_hub.notebook_login",headingTag:"h2"}}),q=new be({props:{name:"huggingface_hub.notebook_login",anchor:"huggingface_hub.notebook_login",parameters:[{name:"skip_if_logged_in",val:": bool = False"}],parametersDescription:[{anchor:"huggingface_hub.notebook_login.skip_if_logged_in",description:`<strong>skip_if_logged_in</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, do not prompt for token if user is already logged in.`,name:"skip_if_logged_in"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_login.py#L293"}}),F=new te({props:{title:"로그아웃",local:"logout ][ huggingface_hub.logout",headingTag:"h2"}}),V=new be({props:{name:"huggingface_hub.logout",anchor:"huggingface_hub.logout",parameters:[{name:"token_name",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"huggingface_hub.logout.token_name",description:`<strong>token_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the access token to logout from. If <code>None</code>, will log out from all saved access tokens.`,name:"token_name"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_login.py#L119",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><a
  href="https://docs.python.org/3/library/exceptions.html#ValueError"
  rel="nofollow"
><code>ValueError</code></a> —
If the access token name is not found.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),O=new tt({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/login.md"}}),{c(){v=g("meta"),ne=o(),Z=g("p"),oe=o(),p(y.$$.fragment),ie=o(),p(T.$$.fragment),ae=o(),L=g("p"),L.innerHTML=De,re=o(),C=g("p"),C.innerHTML=qe,ge=o(),p(H.$$.fragment),le=o(),s=g("div"),p(M.$$.fragment),ke=o(),N=g("p"),N.textContent=Fe,$e=o(),U=g("p"),U.innerHTML=Ve,ve=o(),j=g("p"),j.innerHTML=Oe,xe=o(),S=g("blockquote"),S.innerHTML=ze,we=o(),E=g("blockquote"),E.innerHTML=Ne,se=o(),p(I.$$.fragment),ce=o(),u=g("div"),p(P.$$.fragment),ye=o(),B=g("p"),B.textContent=Ue,Te=o(),K=g("p"),K.innerHTML=je,Le=o(),Q=g("p"),Q.innerHTML=Se,ue=o(),p(D.$$.fragment),de=o(),d=g("div"),p(q.$$.fragment),Ce=o(),A=g("p"),A.textContent=Be,He=o(),G=g("p"),G.innerHTML=Ke,Me=o(),R=g("p"),R.innerHTML=Qe,he=o(),p(F.$$.fragment),fe=o(),f=g("div"),p(V.$$.fragment),Ee=o(),W=g("p"),W.textContent=Ae,Ie=o(),J=g("p"),J.textContent=Ge,pe=o(),p(O.$$.fragment),me=o(),ee=g("p"),this.h()},l(e){const t=Ze("svelte-u9bgzb",document.head);v=l(t,"META",{name:!0,content:!0}),t.forEach(n),ne=i(e),Z=l(e,"P",{}),Y(Z).forEach(n),oe=i(e),m(y.$$.fragment,e),ie=i(e),m(T.$$.fragment,e),ae=i(e),L=l(e,"P",{"data-svelte-h":!0}),c(L)!=="svelte-n6pnyz"&&(L.innerHTML=De),re=i(e),C=l(e,"P",{"data-svelte-h":!0}),c(C)!=="svelte-arqyzt"&&(C.innerHTML=qe),ge=i(e),m(H.$$.fragment,e),le=i(e),s=l(e,"DIV",{class:!0});var h=Y(s);m(M.$$.fragment,h),ke=i(h),N=l(h,"P",{"data-svelte-h":!0}),c(N)!=="svelte-h0rxjs"&&(N.textContent=Fe),$e=i(h),U=l(h,"P",{"data-svelte-h":!0}),c(U)!=="svelte-1m8kult"&&(U.innerHTML=Ve),ve=i(h),j=l(h,"P",{"data-svelte-h":!0}),c(j)!=="svelte-1lkk86j"&&(j.innerHTML=Oe),xe=i(h),S=l(h,"BLOCKQUOTE",{"data-svelte-h":!0}),c(S)!=="svelte-1tpv9gn"&&(S.innerHTML=ze),we=i(h),E=l(h,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),c(E)!=="svelte-q15git"&&(E.innerHTML=Ne),h.forEach(n),se=i(e),m(I.$$.fragment,e),ce=i(e),u=l(e,"DIV",{class:!0});var x=Y(u);m(P.$$.fragment,x),ye=i(x),B=l(x,"P",{"data-svelte-h":!0}),c(B)!=="svelte-1rvjqhd"&&(B.textContent=Ue),Te=i(x),K=l(x,"P",{"data-svelte-h":!0}),c(K)!=="svelte-1b7ixfc"&&(K.innerHTML=je),Le=i(x),Q=l(x,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-givd4n"&&(Q.innerHTML=Se),x.forEach(n),ue=i(e),m(D.$$.fragment,e),de=i(e),d=l(e,"DIV",{class:!0});var w=Y(d);m(q.$$.fragment,w),Ce=i(w),A=l(w,"P",{"data-svelte-h":!0}),c(A)!=="svelte-bqvn6n"&&(A.textContent=Be),He=i(w),G=l(w,"P",{"data-svelte-h":!0}),c(G)!=="svelte-1nwuyz5"&&(G.innerHTML=Ke),Me=i(w),R=l(w,"P",{"data-svelte-h":!0}),c(R)!=="svelte-givd4n"&&(R.innerHTML=Qe),w.forEach(n),he=i(e),m(F.$$.fragment,e),fe=i(e),f=l(e,"DIV",{class:!0});var X=Y(f);m(V.$$.fragment,X),Ee=i(X),W=l(X,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1462z46"&&(W.textContent=Ae),Ie=i(X),J=l(X,"P",{"data-svelte-h":!0}),c(J)!=="svelte-1x6nsdy"&&(J.textContent=Ge),X.forEach(n),pe=i(e),m(O.$$.fragment,e),me=i(e),ee=l(e,"P",{}),Y(ee).forEach(n),this.h()},h(){z(v,"name","hf:doc:metadata"),z(v,"content",ot),z(E,"class","tip"),z(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){a(document.head,v),r(e,ne,t),r(e,Z,t),r(e,oe,t),_(y,e,t),r(e,ie,t),_(T,e,t),r(e,ae,t),r(e,L,t),r(e,re,t),r(e,C,t),r(e,ge,t),_(H,e,t),r(e,le,t),r(e,s,t),_(M,s,null),a(s,ke),a(s,N),a(s,$e),a(s,U),a(s,ve),a(s,j),a(s,xe),a(s,S),a(s,we),a(s,E),r(e,se,t),_(I,e,t),r(e,ce,t),r(e,u,t),_(P,u,null),a(u,ye),a(u,B),a(u,Te),a(u,K),a(u,Le),a(u,Q),r(e,ue,t),_(D,e,t),r(e,de,t),r(e,d,t),_(q,d,null),a(d,Ce),a(d,A),a(d,He),a(d,G),a(d,Me),a(d,R),r(e,he,t),_(F,e,t),r(e,fe,t),r(e,f,t),_(V,f,null),a(f,Ee),a(f,W),a(f,Ie),a(f,J),r(e,pe,t),_(O,e,t),r(e,me,t),r(e,ee,t),_e=!0},p:We,i(e){_e||(b(y.$$.fragment,e),b(T.$$.fragment,e),b(H.$$.fragment,e),b(M.$$.fragment,e),b(I.$$.fragment,e),b(P.$$.fragment,e),b(D.$$.fragment,e),b(q.$$.fragment,e),b(F.$$.fragment,e),b(V.$$.fragment,e),b(O.$$.fragment,e),_e=!0)},o(e){k(y.$$.fragment,e),k(T.$$.fragment,e),k(H.$$.fragment,e),k(M.$$.fragment,e),k(I.$$.fragment,e),k(P.$$.fragment,e),k(D.$$.fragment,e),k(q.$$.fragment,e),k(F.$$.fragment,e),k(V.$$.fragment,e),k(O.$$.fragment,e),_e=!1},d(e){e&&(n(ne),n(Z),n(oe),n(ie),n(ae),n(L),n(re),n(C),n(ge),n(le),n(s),n(se),n(ce),n(u),n(ue),n(de),n(d),n(he),n(fe),n(f),n(pe),n(me),n(ee)),n(v),$(y,e),$(T,e),$(H,e),$(M),$(I,e),$(P),$(D,e),$(q),$(F,e),$(V),$(O,e)}}}const ot='{"title":"로그인 및 로그아웃","local":"login-and-logout","sections":[{"title":"로그인","local":"login ][ huggingface_hub.login","sections":[],"depth":2},{"title":"인터프리터_로그인","local":"interpreter_login ][ huggingface_hub.interpreter_login","sections":[],"depth":2},{"title":"노트북_로그인","local":"notebook_login ][ huggingface_hub.notebook_login","sections":[],"depth":2},{"title":"로그아웃","local":"logout ][ huggingface_hub.logout","sections":[],"depth":2}],"depth":1}';function it(Pe){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class st extends Xe{constructor(v){super(),Ye(this,v,it,nt,Re,{})}}export{st as component};
