import{s as We,o as Be,n as Re}from"../chunks/scheduler.6062bdaf.js";import{S as Je,i as Ke,g,s as o,r as _,A as Qe,h as l,f as n,c as i,j as ee,u as m,x as d,k as te,y as a,a as s,v as b,d as $,t as v,w}from"../chunks/index.4bca734e.js";import{T as Ge}from"../chunks/Tip.b9ac1f03.js";import{D as me}from"../chunks/Docstring.d7918b6d.js";import{H as oe,E as Xe}from"../chunks/EditOnGithub.74ab2baa.js";function Ye(U){let r,T=`<a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.login">login()</a> is a drop-in replacement method for <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.notebook_login">notebook_login()</a> as it wraps and
extends its capabilities.`;return{c(){r=g("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),d(r)!=="svelte-s37sbo"&&(r.innerHTML=T)},m(c,y){s(c,r,y)},p:Re,d(c){c&&n(r)}}}function Ze(U){let r,T=`When the token is not passed, <a href="/docs/huggingface_hub/pr_2397/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/pr_2397/ko/package_reference/login#huggingface_hub.notebook_login">notebook_login()</a> or <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.interpreter_login">interpreter_login()</a>.`;return{c(){r=g("p"),r.innerHTML=T},l(c){r=l(c,"P",{"data-svelte-h":!0}),d(r)!=="svelte-1kty2m3"&&(r.innerHTML=T)},m(c,y){s(c,r,y)},p:Re,d(c){c&&n(r)}}}function et(U){let r,T,c,y,I,ie,M,Pe="<code>huggingface_hub</code> 라이브러리를 사용하면 사용자의 기기를 Hub에 프로그래밍적으로 로그인/로그아웃할 수 있습니다.",re,P,Ee='인증에 대한 자세한 내용은 <a href="../quick-start#authentication">이 섹션</a>을 확인하세요.',ae,E,se,u,D,be,A,De="Login the machine to access the Hub.",$e,N,Fe=`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,G,qe=`To login from outside of a script, one can also use <code>huggingface-cli login</code> which is
a cli command that wraps <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.login">login()</a>.`,we,H,ke,L,ge,F,le,f,q,xe,R,Ve="Displays a prompt to login to the HF website and store the token.",Te,W,je=`This is equivalent to <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.login">login()</a> without passing a token when not run in a notebook.
<a href="/docs/huggingface_hub/pr_2397/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.`,ye,B,ze='For more details, see <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.login">login()</a>.',ce,V,ue,p,j,He,J,Oe="Displays a widget to login to the HF website and store the token.",Le,K,Se=`This is equivalent to <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.login">login()</a> without passing a token when run in a notebook.
<a href="/docs/huggingface_hub/pr_2397/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.`,Ce,Q,Ue='For more details, see <a href="/docs/huggingface_hub/pr_2397/ko/package_reference/login#huggingface_hub.login">login()</a>.',he,z,de,k,O,Ie,X,Ae="Logout the machine from the Hub.",Me,Y,Ne="Token is deleted from the machine and removed from git credential.",fe,S,pe,ne,_e;return I=new oe({props:{title:"로그인 및 로그아웃",local:"login-and-logout",headingTag:"h1"}}),E=new oe({props:{title:"로그인",local:"login ][ huggingface_hub.login",headingTag:"h2"}}),D=new me({props:{name:"huggingface_hub.login",anchor:"huggingface_hub.login",parameters:[{name:"token",val:": Optional = None"},{name:"add_to_git_credential",val:": bool = False"},{name:"new_session",val:": bool = True"},{name:"write_permission",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.new_session",description:`<strong>new_session</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
If <code>True</code>, will request a token even if one is already saved on the machine.`,name:"new_session"},{anchor:"huggingface_hub.login.write_permission",description:`<strong>write_permission</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, requires a token with write permission.`,name:"write_permission"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2397/src/huggingface_hub/_login.py#L50",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 login.</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>
`}}),H=new Ge({props:{$$slots:{default:[Ye]},$$scope:{ctx:U}}}),L=new Ge({props:{$$slots:{default:[Ze]},$$scope:{ctx:U}}}),F=new oe({props:{title:"인터프리터_로그인",local:"interpreter_login ][ huggingface_hub.interpreter_login",headingTag:"h2"}}),q=new me({props:{name:"huggingface_hub.interpreter_login",anchor:"huggingface_hub.interpreter_login",parameters:[{name:"new_session",val:": bool = True"},{name:"write_permission",val:": bool = False"}],parametersDescription:[{anchor:"huggingface_hub.interpreter_login.new_session",description:`<strong>new_session</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
If <code>True</code>, will request a token even if one is already saved on the machine.`,name:"new_session"},{anchor:"huggingface_hub.interpreter_login.write_permission",description:`<strong>write_permission</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, requires a token with write permission.`,name:"write_permission"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2397/src/huggingface_hub/_login.py#L156"}}),V=new oe({props:{title:"노트북_로그인",local:"notebook_login ][ huggingface_hub.notebook_login",headingTag:"h2"}}),j=new me({props:{name:"huggingface_hub.notebook_login",anchor:"huggingface_hub.notebook_login",parameters:[{name:"new_session",val:": bool = True"},{name:"write_permission",val:": bool = False"}],parametersDescription:[{anchor:"huggingface_hub.notebook_login.new_session",description:`<strong>new_session</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
If <code>True</code>, will request a token even if one is already saved on the machine.`,name:"new_session"},{anchor:"huggingface_hub.notebook_login.write_permission",description:`<strong>write_permission</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, requires a token with write permission.`,name:"write_permission"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2397/src/huggingface_hub/_login.py#L221"}}),z=new oe({props:{title:"로그아웃",local:"logout ][ huggingface_hub.logout",headingTag:"h2"}}),O=new me({props:{name:"huggingface_hub.logout",anchor:"huggingface_hub.logout",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2397/src/huggingface_hub/_login.py#L118"}}),S=new Xe({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/login.md"}}),{c(){r=g("meta"),T=o(),c=g("p"),y=o(),_(I.$$.fragment),ie=o(),M=g("p"),M.innerHTML=Pe,re=o(),P=g("p"),P.innerHTML=Ee,ae=o(),_(E.$$.fragment),se=o(),u=g("div"),_(D.$$.fragment),be=o(),A=g("p"),A.textContent=De,$e=o(),N=g("p"),N.innerHTML=Fe,ve=o(),G=g("p"),G.innerHTML=qe,we=o(),_(H.$$.fragment),ke=o(),_(L.$$.fragment),ge=o(),_(F.$$.fragment),le=o(),f=g("div"),_(q.$$.fragment),xe=o(),R=g("p"),R.textContent=Ve,Te=o(),W=g("p"),W.innerHTML=je,ye=o(),B=g("p"),B.innerHTML=ze,ce=o(),_(V.$$.fragment),ue=o(),p=g("div"),_(j.$$.fragment),He=o(),J=g("p"),J.textContent=Oe,Le=o(),K=g("p"),K.innerHTML=Se,Ce=o(),Q=g("p"),Q.innerHTML=Ue,he=o(),_(z.$$.fragment),de=o(),k=g("div"),_(O.$$.fragment),Ie=o(),X=g("p"),X.textContent=Ae,Me=o(),Y=g("p"),Y.textContent=Ne,fe=o(),_(S.$$.fragment),pe=o(),ne=g("p"),this.h()},l(e){const t=Qe("svelte-u9bgzb",document.head);r=l(t,"META",{name:!0,content:!0}),t.forEach(n),T=i(e),c=l(e,"P",{}),ee(c).forEach(n),y=i(e),m(I.$$.fragment,e),ie=i(e),M=l(e,"P",{"data-svelte-h":!0}),d(M)!=="svelte-n6pnyz"&&(M.innerHTML=Pe),re=i(e),P=l(e,"P",{"data-svelte-h":!0}),d(P)!=="svelte-arqyzt"&&(P.innerHTML=Ee),ae=i(e),m(E.$$.fragment,e),se=i(e),u=l(e,"DIV",{class:!0});var h=ee(u);m(D.$$.fragment,h),be=i(h),A=l(h,"P",{"data-svelte-h":!0}),d(A)!=="svelte-h0rxjs"&&(A.textContent=De),$e=i(h),N=l(h,"P",{"data-svelte-h":!0}),d(N)!=="svelte-1m8kult"&&(N.innerHTML=Fe),ve=i(h),G=l(h,"P",{"data-svelte-h":!0}),d(G)!=="svelte-17vfwbp"&&(G.innerHTML=qe),we=i(h),m(H.$$.fragment,h),ke=i(h),m(L.$$.fragment,h),h.forEach(n),ge=i(e),m(F.$$.fragment,e),le=i(e),f=l(e,"DIV",{class:!0});var x=ee(f);m(q.$$.fragment,x),xe=i(x),R=l(x,"P",{"data-svelte-h":!0}),d(R)!=="svelte-17ujnkh"&&(R.textContent=Ve),Te=i(x),W=l(x,"P",{"data-svelte-h":!0}),d(W)!=="svelte-1nc4rmo"&&(W.innerHTML=je),ye=i(x),B=l(x,"P",{"data-svelte-h":!0}),d(B)!=="svelte-1v29fxe"&&(B.innerHTML=ze),x.forEach(n),ce=i(e),m(V.$$.fragment,e),ue=i(e),p=l(e,"DIV",{class:!0});var C=ee(p);m(j.$$.fragment,C),He=i(C),J=l(C,"P",{"data-svelte-h":!0}),d(J)!=="svelte-sme73"&&(J.textContent=Oe),Le=i(C),K=l(C,"P",{"data-svelte-h":!0}),d(K)!=="svelte-1vjke0j"&&(K.innerHTML=Se),Ce=i(C),Q=l(C,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-1v29fxe"&&(Q.innerHTML=Ue),C.forEach(n),he=i(e),m(z.$$.fragment,e),de=i(e),k=l(e,"DIV",{class:!0});var Z=ee(k);m(O.$$.fragment,Z),Ie=i(Z),X=l(Z,"P",{"data-svelte-h":!0}),d(X)!=="svelte-1462z46"&&(X.textContent=Ae),Me=i(Z),Y=l(Z,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-1x6nsdy"&&(Y.textContent=Ne),Z.forEach(n),fe=i(e),m(S.$$.fragment,e),pe=i(e),ne=l(e,"P",{}),ee(ne).forEach(n),this.h()},h(){te(r,"name","hf:doc:metadata"),te(r,"content",tt),te(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(k,"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,r),s(e,T,t),s(e,c,t),s(e,y,t),b(I,e,t),s(e,ie,t),s(e,M,t),s(e,re,t),s(e,P,t),s(e,ae,t),b(E,e,t),s(e,se,t),s(e,u,t),b(D,u,null),a(u,be),a(u,A),a(u,$e),a(u,N),a(u,ve),a(u,G),a(u,we),b(H,u,null),a(u,ke),b(L,u,null),s(e,ge,t),b(F,e,t),s(e,le,t),s(e,f,t),b(q,f,null),a(f,xe),a(f,R),a(f,Te),a(f,W),a(f,ye),a(f,B),s(e,ce,t),b(V,e,t),s(e,ue,t),s(e,p,t),b(j,p,null),a(p,He),a(p,J),a(p,Le),a(p,K),a(p,Ce),a(p,Q),s(e,he,t),b(z,e,t),s(e,de,t),s(e,k,t),b(O,k,null),a(k,Ie),a(k,X),a(k,Me),a(k,Y),s(e,fe,t),b(S,e,t),s(e,pe,t),s(e,ne,t),_e=!0},p(e,[t]){const h={};t&2&&(h.$$scope={dirty:t,ctx:e}),H.$set(h);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),L.$set(x)},i(e){_e||($(I.$$.fragment,e),$(E.$$.fragment,e),$(D.$$.fragment,e),$(H.$$.fragment,e),$(L.$$.fragment,e),$(F.$$.fragment,e),$(q.$$.fragment,e),$(V.$$.fragment,e),$(j.$$.fragment,e),$(z.$$.fragment,e),$(O.$$.fragment,e),$(S.$$.fragment,e),_e=!0)},o(e){v(I.$$.fragment,e),v(E.$$.fragment,e),v(D.$$.fragment,e),v(H.$$.fragment,e),v(L.$$.fragment,e),v(F.$$.fragment,e),v(q.$$.fragment,e),v(V.$$.fragment,e),v(j.$$.fragment,e),v(z.$$.fragment,e),v(O.$$.fragment,e),v(S.$$.fragment,e),_e=!1},d(e){e&&(n(T),n(c),n(y),n(ie),n(M),n(re),n(P),n(ae),n(se),n(u),n(ge),n(le),n(f),n(ce),n(ue),n(p),n(he),n(de),n(k),n(fe),n(pe),n(ne)),n(r),w(I,e),w(E,e),w(D),w(H),w(L),w(F,e),w(q),w(V,e),w(j),w(z,e),w(O),w(S,e)}}}const tt='{"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 nt(U){return Be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gt extends Je{constructor(r){super(),Ke(this,r,nt,et,We,{})}}export{gt as component};
