import{s as we,o as Me,n as ke}from"../chunks/scheduler.0cf4ef2e.js";import{S as He,i as Se,e as p,s as a,c as b,h as Fe,a as m,d as s,b as o,f as R,g as _,j as M,k as I,l as n,m as f,n as $,t as v,o as x,p as w}from"../chunks/index.abc433bf.js";import{C as Ue,H as xe,E as Te}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c5e6f579.js";import{D as se}from"../chunks/Docstring.d25cce65.js";import{C as Ce}from"../chunks/CodeBlock.0951eb7c.js";import{E as je}from"../chunks/ExampleCodeBlock.51f0b6db.js";function Ee(z){let r,F="Usage:",y,g,h;return g=new Ce({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(){r=p("p"),r.textContent=F,y=a(),b(g.$$.fragment)},l(i){r=m(i,"P",{"data-svelte-h":!0}),M(r)!=="svelte-5wyjqd"&&(r.textContent=F),y=o(i),_(g.$$.fragment,i)},m(i,u){f(i,r,u),f(i,y,u),$(g,i,u),h=!0},p:ke,i(i){h||(v(g.$$.fragment,i),h=!0)},o(i){x(g.$$.fragment,i),h=!1},d(i){i&&(s(r),s(y)),w(g,i)}}}function Ge(z){let r,F,y,g,h,i,u,A,U,ge='<a href="/docs/huggingface_hub/main/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 파일 인터페이스를 제공합니다.',V,T,Y,C,he='<a href="/docs/huggingface_hub/main/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>를 확인하세요.',B,l,j,ne,q,de="Access a remote Hugging Face Hub repository as if were a local file system.",ae,P,ue=`<p>[!WARNING][HfFileSystem](/docs/huggingface_hub/main/ko/package_reference/hf_file_system#huggingface_hub.HfFileSystem) provides fsspec compatibility, which is useful for libraries that require it (e.g., reading
Hugging Face datasets directly with <code>pandas</code>). However, it introduces additional overhead due to this compatibility
layer. For better performance and reliability, it’s recommended to use <code>HfApi</code> methods when possible.</p>`,oe,k,ie,N,E,le,H,G,re,X,ye="Resolve a Hugging Face file system path into its components.",ce,d,L,pe,D,be="List the contents of a directory.",me,W,_e='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.ls" rel="nofollow">fsspec documentation</a>.',fe,J,$e="<p>Note: When possible, use <code>HfApi.list_repo_tree()</code> for better performance.</p>",K,Z,O,Q,ee;return h=new Ue({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),u=new xe({props:{title:"파일 시스템 API",local:"filesystem-api",headingTag:"h1"}}),T=new xe({props:{title:"HfFileSystem",local:"huggingface_hub.HfFileSystem",headingTag:"h2"}}),j=new se({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"},{anchor:"huggingface_hub.HfFileSystem.endpoint",description:`<strong>endpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Endpoint of the Hub. Defaults to <a href="https://huggingface.co" rel="nofollow">https://huggingface.co</a>.`,name:"endpoint"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L116"}}),k=new je({props:{anchor:"huggingface_hub.HfFileSystem.example",$$slots:{default:[Ee]},$$scope:{ctx:z}}}),E=new se({props:{name:"__init__",anchor:"huggingface_hub.HfFileSystem.__init__",parameters:[{name:"*args",val:""},{name:"endpoint",val:": typing.Optional[str] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"block_size",val:": typing.Optional[int] = None"},{name:"**storage_options",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L157"}}),G=new se({props:{name:"resolve_path",anchor:"huggingface_hub.HfFileSystem.resolve_path",parameters:[{name:"path",val:": str"},{name:"revision",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.resolve_path.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to resolve.`,name:"path"},{anchor:"huggingface_hub.HfFileSystem.resolve_path.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The revision of the repo to resolve. Defaults to the revision specified in the path.`,name:"revision"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L210",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Resolved path information containing <code>repo_type</code>, <code>repo_id</code>, <code>revision</code> and <code>path_in_repo</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>HfFileSystemResolvedPath</code></p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If path contains conflicting revision information.</li>
<li><code>NotImplementedError</code> —
If trying to list repositories.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code> or <code>NotImplementedError</code></p>
`}}),L=new se({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:": typing.Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.ls.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to the directory.`,name:"path"},{anchor:"huggingface_hub.HfFileSystem.ls.detail",description:`<strong>detail</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If True, returns a list of dictionaries containing file information. If False,
returns a list of file paths. Defaults to True.`,name:"detail"},{anchor:"huggingface_hub.HfFileSystem.ls.refresh",description:`<strong>refresh</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If True, bypass the cache and fetch the latest data. Defaults to False.`,name:"refresh"},{anchor:"huggingface_hub.HfFileSystem.ls.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The git revision to list from.`,name:"revision"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L410",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of file paths (if detail=False) or list of file information
dictionaries (if detail=True).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>list[Union[str, dict[str, Any]]]</code></p>
`}}),Z=new Te({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/hf_file_system.md"}}),{c(){r=p("meta"),F=a(),y=p("p"),g=a(),b(h.$$.fragment),i=a(),b(u.$$.fragment),A=a(),U=p("p"),U.innerHTML=ge,V=a(),b(T.$$.fragment),Y=a(),C=p("p"),C.innerHTML=he,B=a(),l=p("div"),b(j.$$.fragment),ne=a(),q=p("p"),q.textContent=de,ae=a(),P=p("blockquote"),P.innerHTML=ue,oe=a(),b(k.$$.fragment),ie=a(),N=p("div"),b(E.$$.fragment),le=a(),H=p("div"),b(G.$$.fragment),re=a(),X=p("p"),X.textContent=ye,ce=a(),d=p("div"),b(L.$$.fragment),pe=a(),D=p("p"),D.textContent=be,me=a(),W=p("p"),W.innerHTML=_e,fe=a(),J=p("blockquote"),J.innerHTML=$e,K=a(),b(Z.$$.fragment),O=a(),Q=p("p"),this.h()},l(e){const t=Fe("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(s),F=o(e),y=m(e,"P",{}),R(y).forEach(s),g=o(e),_(h.$$.fragment,e),i=o(e),_(u.$$.fragment,e),A=o(e),U=m(e,"P",{"data-svelte-h":!0}),M(U)!=="svelte-149qtx7"&&(U.innerHTML=ge),V=o(e),_(T.$$.fragment,e),Y=o(e),C=m(e,"P",{"data-svelte-h":!0}),M(C)!=="svelte-cnlis"&&(C.innerHTML=he),B=o(e),l=m(e,"DIV",{class:!0});var c=R(l);_(j.$$.fragment,c),ne=o(c),q=m(c,"P",{"data-svelte-h":!0}),M(q)!=="svelte-xq4u8v"&&(q.textContent=de),ae=o(c),P=m(c,"BLOCKQUOTE",{"data-svelte-h":!0}),M(P)!=="svelte-wm722n"&&(P.innerHTML=ue),oe=o(c),_(k.$$.fragment,c),ie=o(c),N=m(c,"DIV",{class:!0});var ve=R(N);_(E.$$.fragment,ve),ve.forEach(s),le=o(c),H=m(c,"DIV",{class:!0});var te=R(H);_(G.$$.fragment,te),re=o(te),X=m(te,"P",{"data-svelte-h":!0}),M(X)!=="svelte-vfdh7r"&&(X.textContent=ye),te.forEach(s),ce=o(c),d=m(c,"DIV",{class:!0});var S=R(d);_(L.$$.fragment,S),pe=o(S),D=m(S,"P",{"data-svelte-h":!0}),M(D)!=="svelte-f8hcny"&&(D.textContent=be),me=o(S),W=m(S,"P",{"data-svelte-h":!0}),M(W)!=="svelte-17yp07o"&&(W.innerHTML=_e),fe=o(S),J=m(S,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),M(J)!=="svelte-1hchker"&&(J.innerHTML=$e),S.forEach(s),c.forEach(s),K=o(e),_(Z.$$.fragment,e),O=o(e),Q=m(e,"P",{}),R(Q).forEach(s),this.h()},h(){I(r,"name","hf:doc:metadata"),I(r,"content",Le),I(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(J,"class","warning"),I(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(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,t){n(document.head,r),f(e,F,t),f(e,y,t),f(e,g,t),$(h,e,t),f(e,i,t),$(u,e,t),f(e,A,t),f(e,U,t),f(e,V,t),$(T,e,t),f(e,Y,t),f(e,C,t),f(e,B,t),f(e,l,t),$(j,l,null),n(l,ne),n(l,q),n(l,ae),n(l,P),n(l,oe),$(k,l,null),n(l,ie),n(l,N),$(E,N,null),n(l,le),n(l,H),$(G,H,null),n(H,re),n(H,X),n(l,ce),n(l,d),$(L,d,null),n(d,pe),n(d,D),n(d,me),n(d,W),n(d,fe),n(d,J),f(e,K,t),$(Z,e,t),f(e,O,t),f(e,Q,t),ee=!0},p(e,[t]){const c={};t&2&&(c.$$scope={dirty:t,ctx:e}),k.$set(c)},i(e){ee||(v(h.$$.fragment,e),v(u.$$.fragment,e),v(T.$$.fragment,e),v(j.$$.fragment,e),v(k.$$.fragment,e),v(E.$$.fragment,e),v(G.$$.fragment,e),v(L.$$.fragment,e),v(Z.$$.fragment,e),ee=!0)},o(e){x(h.$$.fragment,e),x(u.$$.fragment,e),x(T.$$.fragment,e),x(j.$$.fragment,e),x(k.$$.fragment,e),x(E.$$.fragment,e),x(G.$$.fragment,e),x(L.$$.fragment,e),x(Z.$$.fragment,e),ee=!1},d(e){e&&(s(F),s(y),s(g),s(i),s(A),s(U),s(V),s(Y),s(C),s(B),s(l),s(K),s(O),s(Q)),s(r),w(h,e),w(u,e),w(T,e),w(j),w(k),w(E),w(G),w(L),w(Z,e)}}}const Le='{"title":"파일 시스템 API","local":"filesystem-api","sections":[{"title":"HfFileSystem","local":"huggingface_hub.HfFileSystem","sections":[],"depth":2}],"depth":1}';function Je(z){return Me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class De extends He{constructor(r){super(),Se(this,r,Je,Ge,we,{})}}export{De as component};
