import{s as ze,o as We,n as Ae}from"../chunks/scheduler.6062bdaf.js";import{S as De,i as Ne,g as n,s,r as x,A as Qe,h as l,f as i,c as a,j as B,u as w,x as g,k as K,y as t,a as d,v as C,d as M,t as k,w as U}from"../chunks/index.4bca734e.js";import{D as oe}from"../chunks/Docstring.d7918b6d.js";import{C as Ye}from"../chunks/CodeBlock.fa01571c.js";import{E as Re}from"../chunks/ExampleCodeBlock.d27cbfa4.js";import{H as Xe,E as Ve}from"../chunks/EditOnGithub.74ab2baa.js";function Be(ee){let m,S="Usage:",$,y,_;return y=new Ye({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMEhmRmlsZVN5c3RlbSUwQSUwQWZzJTIwJTNEJTIwSGZGaWxlU3lzdGVtKCklMEElMEElMjMlMjBMaXN0JTIwZmlsZXMlMEFmcy5nbG9iKCUyMm15LXVzZXJuYW1lJTJGbXktbW9kZWwlMkYqLmJpbiUyMiklMEFmcy5scyglMjJkYXRhc2V0cyUyRm15LXVzZXJuYW1lJTJGbXktZGF0YXNldCUyMiUyQyUyMGRldGFpbCUzREZhbHNlKSUwQSUwQSUyMyUyMFJlYWQlMkZ3cml0ZSUyMGZpbGVzJTBBd2l0aCUyMGZzLm9wZW4oJTIybXktdXNlcm5hbWUlMkZteS1tb2RlbCUyRnB5dG9yY2hfbW9kZWwuYmluJTIyKSUyMGFzJTIwZiUzQSUwQSUyMCUyMCUyMCUyMGRhdGElMjAlM0QlMjBmLnJlYWQoKSUwQXdpdGglMjBmcy5vcGVuKCUyMm15LXVzZXJuYW1lJTJGbXktbW9kZWwlMkZweXRvcmNoX21vZGVsLmJpbiUyMiUyQyUyMCUyMndiJTIyKSUyMGFzJTIwZiUzQSUwQSUyMCUyMCUyMCUyMGYud3JpdGUoZGF0YSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> HfFileSystem

<span class="hljs-meta">&gt;&gt;&gt; </span>fs = HfFileSystem()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># List files</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>fs.glob(<span class="hljs-string">&quot;my-username/my-model/*.bin&quot;</span>)
[<span class="hljs-string">&#x27;my-username/my-model/pytorch_model.bin&#x27;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>fs.ls(<span class="hljs-string">&quot;datasets/my-username/my-dataset&quot;</span>, detail=<span class="hljs-literal">False</span>)
[<span class="hljs-string">&#x27;datasets/my-username/my-dataset/.gitattributes&#x27;</span>, <span class="hljs-string">&#x27;datasets/my-username/my-dataset/README.md&#x27;</span>, <span class="hljs-string">&#x27;datasets/my-username/my-dataset/data.json&#x27;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Read/write files</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> fs.<span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;my-username/my-model/pytorch_model.bin&quot;</span>) <span class="hljs-keyword">as</span> f:
<span class="hljs-meta">... </span>    data = f.read()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> fs.<span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;my-username/my-model/pytorch_model.bin&quot;</span>, <span class="hljs-string">&quot;wb&quot;</span>) <span class="hljs-keyword">as</span> f:
<span class="hljs-meta">... </span>    f.write(data)`,wrap:!1}}),{c(){m=n("p"),m.textContent=S,$=s(),x(y.$$.fragment)},l(c){m=l(c,"P",{"data-svelte-h":!0}),g(m)!=="svelte-5wyjqd"&&(m.textContent=S),$=a(c),w(y.$$.fragment,c)},m(c,v){d(c,m,v),d(c,$,v),C(y,c,v),_=!0},p:Ae,i(c){_||(M(y.$$.fragment,c),_=!0)},o(c){k(y.$$.fragment,c),_=!1},d(c){c&&(i(m),i($)),U(y,c)}}}function Ke(ee){let m,S,$,y,_,c,v,Me='<a href="/docs/huggingface_hub/pr_2404/ko/package_reference/hf_file_system#huggingface_hub.HfFileSystem">HfFileSystem</a> 클래스는 <a href="https://filesystem-spec.readthedocs.io/en/latest/" rel="nofollow"><code>fsspec</code></a>을 기반으로 Hugging Face Hub에 Python 파일 인터페이스를 제공합니다.',te,F,se,T,ke='<a href="/docs/huggingface_hub/pr_2404/ko/package_reference/hf_file_system#huggingface_hub.HfFileSystem">HfFileSystem</a>은 <a href="https://filesystem-spec.readthedocs.io/en/latest/" rel="nofollow"><code>fsspec</code></a>을 기반으로 하므로 제공되는 대부분의 API와 호환됩니다. 자세한 내용은 <a href="../guides/hf_file_system">가이드</a> 및 fsspec의 <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem" rel="nofollow">API 레퍼런스</a>를 확인하세요.',ae,p,H,re,Z,Ue="Access a remote Hugging Face Hub repository as if were a local file system.",ce,j,me,h,G,pe,E,je='<em>Docstring taken from <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.__init__" rel="nofollow">fsspec documentation</a>.</em>',he,q,Se="Create and configure file-system instance",fe,I,Fe=`Instances may be cachable, so if similar enough arguments are seen
a new instance is not required. The token attribute exists to allow
implementations to cache instances if they wish.`,ge,X,Te="A reasonable default should be provided if there are no arguments.",ue,z,He="Subclasses should call this method.",de,W,L,ye,r,P,_e,A,Ge='<em>Docstring taken from <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.ls" rel="nofollow">fsspec documentation</a>.</em>',be,D,Le="List objects at path.",ve,N,Pe=`This should include subdirectories and files at that location. The
difference between a file and a directory must be clear when details
are requested.`,$e,Q,Je=`The specific keys, or perhaps a FileInfo class, or similar, is TBD,
but must be consistent across implementations.
Must include:`,xe,Y,Ze=`<li>full path to the entry (without protocol)</li> <li>size of the entry, in bytes. If the value cannot be determined, will
be <code>None</code>.</li> <li>type of entry, “file”, “directory” or other</li>`,we,R,Ee=`Additional information
may be present, appropriate to the file-system, e.g., generation,
checksum, etc.`,Ce,V,qe=`May use refresh=True|False to allow use of self._ls_from_cache to
check for a saved listing and avoid calling the backend. This would be
common where listing may be expensive.`,ne,J,le,O,ie;return _=new Xe({props:{title:"파일 시스템 API",local:"filesystem-api",headingTag:"h1"}}),F=new Xe({props:{title:"HfFileSystem",local:"huggingface_hub.HfFileSystem",headingTag:"h2"}}),H=new oe({props:{name:"class huggingface_hub.HfFileSystem",anchor:"huggingface_hub.HfFileSystem",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
A valid user access token (string). Defaults to the locally saved
token, which is the recommended method for authentication (see
<a href="https://huggingface.co/docs/huggingface_hub/quick-start#authentication" rel="nofollow">https://huggingface.co/docs/huggingface_hub/quick-start#authentication</a>).
To disable authentication, pass <code>False</code>.`,name:"token"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2404/src/huggingface_hub/hf_file_system.py#L73"}}),j=new Re({props:{anchor:"huggingface_hub.HfFileSystem.example",$$slots:{default:[Be]},$$scope:{ctx:ee}}}),G=new oe({props:{name:"__init__",anchor:"huggingface_hub.HfFileSystem.__init__",parameters:[{name:"*args",val:""},{name:"endpoint",val:": Optional = None"},{name:"token",val:": Union = None"},{name:"**storage_options",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.__init__.use_listings_cache,",description:`<strong>use_listings_cache,</strong> listings_expiry_time, max_paths &#x2014;
passed to <code>DirCache</code>, if the implementation supports
directory listing caching. Pass use_listings_cache=False
to disable such caching.
skip_instance_cache &#x2014; bool
If this is a cachable implementation, pass True here to force
creating a new instance even if a matching instance exists, and prevent
storing this instance.
asynchronous &#x2014; bool
loop &#x2014; asyncio-compatible IOLoop or None`,name:"use_listings_cache,"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2404/src/huggingface_hub/hf_file_system.py#L108"}}),L=new oe({props:{name:"resolve_path",anchor:"huggingface_hub.HfFileSystem.resolve_path",parameters:[{name:"path",val:": str"},{name:"revision",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2404/src/huggingface_hub/hf_file_system.py#L143"}}),P=new oe({props:{name:"ls",anchor:"huggingface_hub.HfFileSystem.ls",parameters:[{name:"path",val:": str"},{name:"detail",val:": bool = True"},{name:"refresh",val:": bool = False"},{name:"revision",val:": Optional = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2404/src/huggingface_hub/hf_file_system.py#L284",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of strings if detail is False, or list of directory information
dicts if detail is True.</p>
`}}),J=new Ve({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/hf_file_system.md"}}),{c(){m=n("meta"),S=s(),$=n("p"),y=s(),x(_.$$.fragment),c=s(),v=n("p"),v.innerHTML=Me,te=s(),x(F.$$.fragment),se=s(),T=n("p"),T.innerHTML=ke,ae=s(),p=n("div"),x(H.$$.fragment),re=s(),Z=n("p"),Z.textContent=Ue,ce=s(),x(j.$$.fragment),me=s(),h=n("div"),x(G.$$.fragment),pe=s(),E=n("p"),E.innerHTML=je,he=s(),q=n("p"),q.textContent=Se,fe=s(),I=n("p"),I.textContent=Fe,ge=s(),X=n("p"),X.textContent=Te,ue=s(),z=n("p"),z.textContent=He,de=s(),W=n("div"),x(L.$$.fragment),ye=s(),r=n("div"),x(P.$$.fragment),_e=s(),A=n("p"),A.innerHTML=Ge,be=s(),D=n("p"),D.textContent=Le,ve=s(),N=n("p"),N.textContent=Pe,$e=s(),Q=n("p"),Q.textContent=Je,xe=s(),Y=n("ul"),Y.innerHTML=Ze,we=s(),R=n("p"),R.textContent=Ee,Ce=s(),V=n("p"),V.textContent=qe,ne=s(),x(J.$$.fragment),le=s(),O=n("p"),this.h()},l(e){const o=Qe("svelte-u9bgzb",document.head);m=l(o,"META",{name:!0,content:!0}),o.forEach(i),S=a(e),$=l(e,"P",{}),B($).forEach(i),y=a(e),w(_.$$.fragment,e),c=a(e),v=l(e,"P",{"data-svelte-h":!0}),g(v)!=="svelte-4bhllj"&&(v.innerHTML=Me),te=a(e),w(F.$$.fragment,e),se=a(e),T=l(e,"P",{"data-svelte-h":!0}),g(T)!=="svelte-ed6r9i"&&(T.innerHTML=ke),ae=a(e),p=l(e,"DIV",{class:!0});var u=B(p);w(H.$$.fragment,u),re=a(u),Z=l(u,"P",{"data-svelte-h":!0}),g(Z)!=="svelte-xq4u8v"&&(Z.textContent=Ue),ce=a(u),w(j.$$.fragment,u),me=a(u),h=l(u,"DIV",{class:!0});var b=B(h);w(G.$$.fragment,b),pe=a(b),E=l(b,"P",{"data-svelte-h":!0}),g(E)!=="svelte-1lg9e07"&&(E.innerHTML=je),he=a(b),q=l(b,"P",{"data-svelte-h":!0}),g(q)!=="svelte-6mr0mw"&&(q.textContent=Se),fe=a(b),I=l(b,"P",{"data-svelte-h":!0}),g(I)!=="svelte-1ezkvwe"&&(I.textContent=Fe),ge=a(b),X=l(b,"P",{"data-svelte-h":!0}),g(X)!=="svelte-1vfq4q7"&&(X.textContent=Te),ue=a(b),z=l(b,"P",{"data-svelte-h":!0}),g(z)!=="svelte-djtx9s"&&(z.textContent=He),b.forEach(i),de=a(u),W=l(u,"DIV",{class:!0});var Ie=B(W);w(L.$$.fragment,Ie),Ie.forEach(i),ye=a(u),r=l(u,"DIV",{class:!0});var f=B(r);w(P.$$.fragment,f),_e=a(f),A=l(f,"P",{"data-svelte-h":!0}),g(A)!=="svelte-4ekjsg"&&(A.innerHTML=Ge),be=a(f),D=l(f,"P",{"data-svelte-h":!0}),g(D)!=="svelte-13qkfyu"&&(D.textContent=Le),ve=a(f),N=l(f,"P",{"data-svelte-h":!0}),g(N)!=="svelte-r2vfzq"&&(N.textContent=Pe),$e=a(f),Q=l(f,"P",{"data-svelte-h":!0}),g(Q)!=="svelte-1t8ax86"&&(Q.textContent=Je),xe=a(f),Y=l(f,"UL",{"data-svelte-h":!0}),g(Y)!=="svelte-kx6yxa"&&(Y.innerHTML=Ze),we=a(f),R=l(f,"P",{"data-svelte-h":!0}),g(R)!=="svelte-ljm3ks"&&(R.textContent=Ee),Ce=a(f),V=l(f,"P",{"data-svelte-h":!0}),g(V)!=="svelte-45veql"&&(V.textContent=qe),f.forEach(i),u.forEach(i),ne=a(e),w(J.$$.fragment,e),le=a(e),O=l(e,"P",{}),B(O).forEach(i),this.h()},h(){K(m,"name","hf:doc:metadata"),K(m,"content",Oe),K(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(p,"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,o){t(document.head,m),d(e,S,o),d(e,$,o),d(e,y,o),C(_,e,o),d(e,c,o),d(e,v,o),d(e,te,o),C(F,e,o),d(e,se,o),d(e,T,o),d(e,ae,o),d(e,p,o),C(H,p,null),t(p,re),t(p,Z),t(p,ce),C(j,p,null),t(p,me),t(p,h),C(G,h,null),t(h,pe),t(h,E),t(h,he),t(h,q),t(h,fe),t(h,I),t(h,ge),t(h,X),t(h,ue),t(h,z),t(p,de),t(p,W),C(L,W,null),t(p,ye),t(p,r),C(P,r,null),t(r,_e),t(r,A),t(r,be),t(r,D),t(r,ve),t(r,N),t(r,$e),t(r,Q),t(r,xe),t(r,Y),t(r,we),t(r,R),t(r,Ce),t(r,V),d(e,ne,o),C(J,e,o),d(e,le,o),d(e,O,o),ie=!0},p(e,[o]){const u={};o&2&&(u.$$scope={dirty:o,ctx:e}),j.$set(u)},i(e){ie||(M(_.$$.fragment,e),M(F.$$.fragment,e),M(H.$$.fragment,e),M(j.$$.fragment,e),M(G.$$.fragment,e),M(L.$$.fragment,e),M(P.$$.fragment,e),M(J.$$.fragment,e),ie=!0)},o(e){k(_.$$.fragment,e),k(F.$$.fragment,e),k(H.$$.fragment,e),k(j.$$.fragment,e),k(G.$$.fragment,e),k(L.$$.fragment,e),k(P.$$.fragment,e),k(J.$$.fragment,e),ie=!1},d(e){e&&(i(S),i($),i(y),i(c),i(v),i(te),i(se),i(T),i(ae),i(p),i(ne),i(le),i(O)),i(m),U(_,e),U(F,e),U(H),U(j),U(G),U(L),U(P),U(J,e)}}}const Oe='{"title":"파일 시스템 API","local":"filesystem-api","sections":[{"title":"HfFileSystem","local":"huggingface_hub.HfFileSystem","sections":[],"depth":2}],"depth":1}';function et(ee){return We(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ot extends De{constructor(m){super(),Ne(this,m,et,Ke,ze,{})}}export{ot as component};
