import{s as me,o as ce,n as ge}from"../chunks/scheduler.6062bdaf.js";import{S as pe,i as fe,g as f,s as o,r as y,A as he,h,f as t,c as i,j as X,u as b,x as I,k as L,y as p,a as m,v as _,d as $,t as v,w}from"../chunks/index.4bca734e.js";import{D as A}from"../chunks/Docstring.d7918b6d.js";import{C as ue}from"../chunks/CodeBlock.fa01571c.js";import{E as de}from"../chunks/ExampleCodeBlock.d27cbfa4.js";import{H as ie,E as ye}from"../chunks/EditOnGithub.74ab2baa.js";function be(P){let n,k="Usage:",d,c,g;return c=new ue({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(){n=f("p"),n.textContent=k,d=o(),y(c.$$.fragment)},l(a){n=h(a,"P",{"data-svelte-h":!0}),I(n)!=="svelte-5wyjqd"&&(n.textContent=k),d=i(a),b(c.$$.fragment,a)},m(a,u){m(a,n,u),m(a,d,u),_(c,a,u),g=!0},p:ge,i(a){g||($(c.$$.fragment,a),g=!0)},o(a){v(c.$$.fragment,a),g=!1},d(a){a&&(t(n),t(d)),w(c,a)}}}function _e(P){let n,k,d,c,g,a,u,se='<a href="/docs/huggingface_hub/pr_2366/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 파일 인터페이스를 제공합니다.',W,j,z,S,ae='<a href="/docs/huggingface_hub/pr_2366/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>를 확인하세요.',Q,l,x,D,J,ne="Access a remote Hugging Face Hub repository as if were a local file system.",B,M,K,Z,F,O,E,C,ee,U,G,te,T,le="List the contents of a directory.",Y,H,R,q,V;return g=new ie({props:{title:"파일 시스템 API",local:"filesystem-api",headingTag:"h1"}}),j=new ie({props:{title:"HfFileSystem",local:"huggingface_hub.HfFileSystem",headingTag:"h2"}}),x=new A({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_2366/src/huggingface_hub/hf_file_system.py#L72"}}),M=new de({props:{anchor:"huggingface_hub.HfFileSystem.example",$$slots:{default:[be]},$$scope:{ctx:P}}}),F=new A({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:""}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2366/src/huggingface_hub/hf_file_system.py#L107"}}),C=new A({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_2366/src/huggingface_hub/hf_file_system.py#L142"}}),G=new A({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_2366/src/huggingface_hub/hf_file_system.py#L283"}}),H=new ye({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/hf_file_system.md"}}),{c(){n=f("meta"),k=o(),d=f("p"),c=o(),y(g.$$.fragment),a=o(),u=f("p"),u.innerHTML=se,W=o(),y(j.$$.fragment),z=o(),S=f("p"),S.innerHTML=ae,Q=o(),l=f("div"),y(x.$$.fragment),D=o(),J=f("p"),J.textContent=ne,B=o(),y(M.$$.fragment),K=o(),Z=f("div"),y(F.$$.fragment),O=o(),E=f("div"),y(C.$$.fragment),ee=o(),U=f("div"),y(G.$$.fragment),te=o(),T=f("p"),T.textContent=le,Y=o(),y(H.$$.fragment),R=o(),q=f("p"),this.h()},l(e){const s=he("svelte-u9bgzb",document.head);n=h(s,"META",{name:!0,content:!0}),s.forEach(t),k=i(e),d=h(e,"P",{}),X(d).forEach(t),c=i(e),b(g.$$.fragment,e),a=i(e),u=h(e,"P",{"data-svelte-h":!0}),I(u)!=="svelte-1z41s4"&&(u.innerHTML=se),W=i(e),b(j.$$.fragment,e),z=i(e),S=h(e,"P",{"data-svelte-h":!0}),I(S)!=="svelte-gqxju1"&&(S.innerHTML=ae),Q=i(e),l=h(e,"DIV",{class:!0});var r=X(l);b(x.$$.fragment,r),D=i(r),J=h(r,"P",{"data-svelte-h":!0}),I(J)!=="svelte-xq4u8v"&&(J.textContent=ne),B=i(r),b(M.$$.fragment,r),K=i(r),Z=h(r,"DIV",{class:!0});var re=X(Z);b(F.$$.fragment,re),re.forEach(t),O=i(r),E=h(r,"DIV",{class:!0});var oe=X(E);b(C.$$.fragment,oe),oe.forEach(t),ee=i(r),U=h(r,"DIV",{class:!0});var N=X(U);b(G.$$.fragment,N),te=i(N),T=h(N,"P",{"data-svelte-h":!0}),I(T)!=="svelte-f8hcny"&&(T.textContent=le),N.forEach(t),r.forEach(t),Y=i(e),b(H.$$.fragment,e),R=i(e),q=h(e,"P",{}),X(q).forEach(t),this.h()},h(){L(n,"name","hf:doc:metadata"),L(n,"content",$e),L(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(l,"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,s){p(document.head,n),m(e,k,s),m(e,d,s),m(e,c,s),_(g,e,s),m(e,a,s),m(e,u,s),m(e,W,s),_(j,e,s),m(e,z,s),m(e,S,s),m(e,Q,s),m(e,l,s),_(x,l,null),p(l,D),p(l,J),p(l,B),_(M,l,null),p(l,K),p(l,Z),_(F,Z,null),p(l,O),p(l,E),_(C,E,null),p(l,ee),p(l,U),_(G,U,null),p(U,te),p(U,T),m(e,Y,s),_(H,e,s),m(e,R,s),m(e,q,s),V=!0},p(e,[s]){const r={};s&2&&(r.$$scope={dirty:s,ctx:e}),M.$set(r)},i(e){V||($(g.$$.fragment,e),$(j.$$.fragment,e),$(x.$$.fragment,e),$(M.$$.fragment,e),$(F.$$.fragment,e),$(C.$$.fragment,e),$(G.$$.fragment,e),$(H.$$.fragment,e),V=!0)},o(e){v(g.$$.fragment,e),v(j.$$.fragment,e),v(x.$$.fragment,e),v(M.$$.fragment,e),v(F.$$.fragment,e),v(C.$$.fragment,e),v(G.$$.fragment,e),v(H.$$.fragment,e),V=!1},d(e){e&&(t(k),t(d),t(c),t(a),t(u),t(W),t(z),t(S),t(Q),t(l),t(Y),t(R),t(q)),t(n),w(g,e),w(j,e),w(x),w(M),w(F),w(C),w(G),w(H,e)}}}const $e='{"title":"파일 시스템 API","local":"filesystem-api","sections":[{"title":"HfFileSystem","local":"huggingface_hub.HfFileSystem","sections":[],"depth":2}],"depth":1}';function ve(P){return ce(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xe extends pe{constructor(n){super(),fe(this,n,ve,_e,me,{})}}export{xe as component};
