import{s as Kn,o as Yn,n as es}from"../chunks/scheduler.0cf4ef2e.js";import{S as ts,i as ns,e as a,s as n,c as m,h as ss,a as o,d as c,b as s,f as v,g as h,j as l,k as p,l as e,m as $,n as f,t as g,o as u,p as b}from"../chunks/index.abc433bf.js";import{C as as}from"../chunks/CopyLLMTxtMenu.efc6b005.js";import{D as x}from"../chunks/Docstring.e4170f41.js";import{C as os}from"../chunks/CodeBlock.00dcd05e.js";import{E as rs}from"../chunks/ExampleCodeBlock.9d6d4e26.js";import{H as Bn,E as is}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.86d448e2.js";function ls(rt){let _,W="Usage:",k,H,F;return H=new os({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(){_=a("p"),_.textContent=W,k=n(),m(H.$$.fragment)},l(y){_=o(y,"P",{"data-svelte-h":!0}),l(_)!=="svelte-5wyjqd"&&(_.textContent=W),k=s(y),h(H.$$.fragment,y)},m(y,M){$(y,_,M),$(y,k,M),f(H,y,M),F=!0},p:es,i(y){F||(g(H.$$.fragment,y),F=!0)},o(y){u(H.$$.fragment,y),F=!1},d(y){y&&(c(_),c(k)),b(H,y)}}}function cs(rt){let _,W,k,H,F,y,M,it,z,fn='The <code>HfFileSystem</code> class provides a pythonic file interface to the Hugging Face Hub based on <a href="https://filesystem-spec.readthedocs.io/en/latest/" rel="nofollow"><code>fsspec</code></a>.',lt,Q,ct,X,gn='<code>HfFileSystem</code> is based on <a href="https://filesystem-spec.readthedocs.io/en/latest/" rel="nofollow">fsspec</a>, so it is compatible with most of the APIs that it offers. For more details, check out <a href="../guides/hf_file_system">our guide</a> and fsspec’s <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem" rel="nofollow">API Reference</a>.',pt,r,B,ut,xe,un="Access a remote Hugging Face Hub repository as if were a local file system.",bt,$e,bn=`<p>[!WARNING][HfFileSystem](/docs/huggingface_hub/main/en/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>`,yt,N,vt,He,K,_t,L,Y,xt,Fe,yn="Copy a file within or between repositories.",$t,ee,vn="<p>Note: When possible, use <code>HfApi.upload_file()</code> for better performance.</p>",Ht,w,te,Ft,we,_n="Check if a file exists.",wt,Ce,xn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.exists" rel="nofollow">fsspec documentation</a>.',Ct,ne,$n="<p>Note: When possible, use <code>HfApi.file_exists()</code> for better performance.</p>",Tt,D,se,St,Te,Hn="List all files below path.",Mt,Se,Fn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.find" rel="nofollow">fsspec documentation</a>.',kt,U,ae,Lt,Me,wn="Copy single remote file to local.",Dt,oe,Cn="<p>Note: When possible, use <code>HfApi.hf_hub_download()</code> for better performance.</p>",Ut,P,re,Pt,ke,Tn="Find files by glob-matching.",Et,Le,Sn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.glob" rel="nofollow">fsspec documentation</a>.',It,C,ie,jt,De,Mn="Get information about a file or directory.",qt,Ue,kn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.info" rel="nofollow">fsspec documentation</a>.',At,le,Ln="<p>Note: When possible, use <code>HfApi.get_paths_info()</code> or <code>HfApi.repo_info()</code>  for better performance.</p>",Nt,E,ce,Gt,Pe,Dn="Clear the cache for a given path.",Ot,Ee,Un='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.invalidate_cache" rel="nofollow">fsspec documentation</a>.',Vt,I,pe,Jt,Ie,Pn="Check if a path is a directory.",Zt,je,En='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.isdir" rel="nofollow">fsspec documentation</a>.',Rt,j,de,Wt,qe,In="Check if a path is a file.",zt,Ae,jn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.isfile" rel="nofollow">fsspec documentation</a>.',Qt,T,me,Xt,Ne,qn="List the contents of a directory.",Bt,Ge,An='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>.',Kt,he,Nn="<p>Note: When possible, use <code>HfApi.list_repo_tree()</code> for better performance.</p>",Yt,q,fe,en,Oe,Gn="Get the last modified time of a file.",tn,Ve,On='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.modified" rel="nofollow">fsspec documentation</a>.',nn,G,ge,sn,Je,Vn="Resolve a Hugging Face file system path into its components.",an,S,ue,on,Ze,Jn="Delete files from a repository.",rn,Re,Zn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.rm" rel="nofollow">fsspec documentation</a>.',ln,be,Rn="<p>Note: When possible, use <code>HfApi.delete_file()</code> for better performance.</p>",cn,O,ye,pn,We,Wn="Get the HTTP URL of the given path.",dn,A,ve,mn,ze,zn="Return all files below the given path.",hn,Qe,Qn='For more details, refer to <a href="https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.walk" rel="nofollow">fsspec documentation</a>.',dt,_e,mt,ot,ht;return F=new as({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),M=new Bn({props:{title:"Filesystem API",local:"filesystem-api",headingTag:"h1"}}),Q=new Bn({props:{title:"HfFileSystem",local:"huggingface_hub.HfFileSystem",headingTag:"h2"}}),B=new x({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"}}),N=new rs({props:{anchor:"huggingface_hub.HfFileSystem.example",$$slots:{default:[ls]},$$scope:{ctx:rt}}}),K=new x({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"}}),Y=new x({props:{name:"cp_file",anchor:"huggingface_hub.HfFileSystem.cp_file",parameters:[{name:"path1",val:": str"},{name:"path2",val:": str"},{name:"revision",val:": typing.Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.cp_file.path1",description:`<strong>path1</strong> (<code>str</code>) &#x2014;
Source path to copy from.`,name:"path1"},{anchor:"huggingface_hub.HfFileSystem.cp_file.path2",description:`<strong>path2</strong> (<code>str</code>) &#x2014;
Destination path to copy to.`,name:"path2"},{anchor:"huggingface_hub.HfFileSystem.cp_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The git revision to copy from.`,name:"revision"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L663"}}),te=new x({props:{name:"exists",anchor:"huggingface_hub.HfFileSystem.exists",parameters:[{name:"path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.exists.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to check.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L833",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>True if file exists, False otherwise.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>bool</code></p>
`}}),se=new x({props:{name:"find",anchor:"huggingface_hub.HfFileSystem.find",parameters:[{name:"path",val:": str"},{name:"maxdepth",val:": typing.Optional[int] = None"},{name:"withdirs",val:": bool = False"},{name:"detail",val:": bool = False"},{name:"refresh",val:": bool = False"},{name:"revision",val:": typing.Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.find.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Root path to list files from.`,name:"path"},{anchor:"huggingface_hub.HfFileSystem.find.maxdepth",description:`<strong>maxdepth</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum depth to descend into subdirectories.`,name:"maxdepth"},{anchor:"huggingface_hub.HfFileSystem.find.withdirs",description:`<strong>withdirs</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Include directory paths in the output. Defaults to False.`,name:"withdirs"},{anchor:"huggingface_hub.HfFileSystem.find.detail",description:`<strong>detail</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If True, returns a dict mapping paths to file information. Defaults to False.`,name:"detail"},{anchor:"huggingface_hub.HfFileSystem.find.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.find.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#L600",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of paths or dict of file information.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Union[list[str], dict[str, dict[str, Any]]]</code></p>
`}}),ae=new x({props:{name:"get_file",anchor:"huggingface_hub.HfFileSystem.get_file",parameters:[{name:"rpath",val:""},{name:"lpath",val:""},{name:"callback",val:" = <fsspec.callbacks.NoOpCallback object at 0x7f1786ea5ed0>"},{name:"outfile",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.get_file.rpath",description:`<strong>rpath</strong> (<code>str</code>) &#x2014;
Remote path to download from.`,name:"rpath"},{anchor:"huggingface_hub.HfFileSystem.get_file.lpath",description:`<strong>lpath</strong> (<code>str</code>) &#x2014;
Local path to download to.`,name:"lpath"},{anchor:"huggingface_hub.HfFileSystem.get_file.callback",description:`<strong>callback</strong> (<code>Callback</code>, <em>optional</em>) &#x2014;
Optional callback to track download progress. Defaults to no callback.`,name:"callback"},{anchor:"huggingface_hub.HfFileSystem.get_file.outfile",description:`<strong>outfile</strong> (<code>IO</code>, <em>optional</em>) &#x2014;
Optional file-like object to write to. If provided, <code>lpath</code> is ignored.`,name:"outfile"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L917"}}),re=new x({props:{name:"glob",anchor:"huggingface_hub.HfFileSystem.glob",parameters:[{name:"path",val:": str"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.glob.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path pattern to match.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L584",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of paths matching the pattern.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>list[str]</code></p>
`}}),ie=new x({props:{name:"info",anchor:"huggingface_hub.HfFileSystem.info",parameters:[{name:"path",val:": str"},{name:"refresh",val:": bool = False"},{name:"revision",val:": typing.Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.info.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to get info for.`,name:"path"},{anchor:"huggingface_hub.HfFileSystem.info.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.info.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The git revision to get info from.`,name:"revision"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L735",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Dictionary containing file information (type, size, commit info, etc.).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>dict[str, Any]</code></p>
`}}),ce=new x({props:{name:"invalidate_cache",anchor:"huggingface_hub.HfFileSystem.invalidate_cache",parameters:[{name:"path",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.invalidate_cache.path",description:`<strong>path</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to clear from cache. If not provided, clear the entire cache.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L305"}}),pe=new x({props:{name:"isdir",anchor:"huggingface_hub.HfFileSystem.isdir",parameters:[{name:"path",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.isdir.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to check.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L858",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>True if path is a directory, False otherwise.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>bool</code></p>
`}}),de=new x({props:{name:"isfile",anchor:"huggingface_hub.HfFileSystem.isfile",parameters:[{name:"path",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.isfile.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to check.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L876",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>True if path is a file, False otherwise.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>bool</code></p>
`}}),me=new x({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>
`}}),fe=new x({props:{name:"modified",anchor:"huggingface_hub.HfFileSystem.modified",parameters:[{name:"path",val:": str"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.modified.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to the file.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L719",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Last commit date of the file.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>datetime</code></p>
`}}),ge=new x({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>
`}}),ue=new x({props:{name:"rm",anchor:"huggingface_hub.HfFileSystem.rm",parameters:[{name:"path",val:": str"},{name:"recursive",val:": bool = False"},{name:"maxdepth",val:": typing.Optional[int] = None"},{name:"revision",val:": typing.Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.rm.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to delete.`,name:"path"},{anchor:"huggingface_hub.HfFileSystem.rm.recursive",description:`<strong>recursive</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If True, delete directory and all its contents. Defaults to False.`,name:"recursive"},{anchor:"huggingface_hub.HfFileSystem.rm.maxdepth",description:`<strong>maxdepth</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum number of subdirectories to visit when deleting recursively.`,name:"maxdepth"},{anchor:"huggingface_hub.HfFileSystem.rm.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The git revision to delete from.`,name:"revision"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L364"}}),ye=new x({props:{name:"url",anchor:"huggingface_hub.HfFileSystem.url",parameters:[{name:"path",val:": str"}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.url.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Path to get URL for.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L894",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>HTTP URL to access the file or directory on the Hub.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code></p>
`}}),ve=new x({props:{name:"walk",anchor:"huggingface_hub.HfFileSystem.walk",parameters:[{name:"path",val:": str"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HfFileSystem.walk.path",description:`<strong>path</strong> (<code>str</code>) &#x2014;
Root path to list files from.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_file_system.py#L568",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>An iterator of (path, list of directory names, list of file names) tuples.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Iterator[tuple[str, list[str], list[str]]]</code></p>
`}}),_e=new is({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/hf_file_system.md"}}),{c(){_=a("meta"),W=n(),k=a("p"),H=n(),m(F.$$.fragment),y=n(),m(M.$$.fragment),it=n(),z=a("p"),z.innerHTML=fn,lt=n(),m(Q.$$.fragment),ct=n(),X=a("p"),X.innerHTML=gn,pt=n(),r=a("div"),m(B.$$.fragment),ut=n(),xe=a("p"),xe.textContent=un,bt=n(),$e=a("blockquote"),$e.innerHTML=bn,yt=n(),m(N.$$.fragment),vt=n(),He=a("div"),m(K.$$.fragment),_t=n(),L=a("div"),m(Y.$$.fragment),xt=n(),Fe=a("p"),Fe.textContent=yn,$t=n(),ee=a("blockquote"),ee.innerHTML=vn,Ht=n(),w=a("div"),m(te.$$.fragment),Ft=n(),we=a("p"),we.textContent=_n,wt=n(),Ce=a("p"),Ce.innerHTML=xn,Ct=n(),ne=a("blockquote"),ne.innerHTML=$n,Tt=n(),D=a("div"),m(se.$$.fragment),St=n(),Te=a("p"),Te.textContent=Hn,Mt=n(),Se=a("p"),Se.innerHTML=Fn,kt=n(),U=a("div"),m(ae.$$.fragment),Lt=n(),Me=a("p"),Me.textContent=wn,Dt=n(),oe=a("blockquote"),oe.innerHTML=Cn,Ut=n(),P=a("div"),m(re.$$.fragment),Pt=n(),ke=a("p"),ke.textContent=Tn,Et=n(),Le=a("p"),Le.innerHTML=Sn,It=n(),C=a("div"),m(ie.$$.fragment),jt=n(),De=a("p"),De.textContent=Mn,qt=n(),Ue=a("p"),Ue.innerHTML=kn,At=n(),le=a("blockquote"),le.innerHTML=Ln,Nt=n(),E=a("div"),m(ce.$$.fragment),Gt=n(),Pe=a("p"),Pe.textContent=Dn,Ot=n(),Ee=a("p"),Ee.innerHTML=Un,Vt=n(),I=a("div"),m(pe.$$.fragment),Jt=n(),Ie=a("p"),Ie.textContent=Pn,Zt=n(),je=a("p"),je.innerHTML=En,Rt=n(),j=a("div"),m(de.$$.fragment),Wt=n(),qe=a("p"),qe.textContent=In,zt=n(),Ae=a("p"),Ae.innerHTML=jn,Qt=n(),T=a("div"),m(me.$$.fragment),Xt=n(),Ne=a("p"),Ne.textContent=qn,Bt=n(),Ge=a("p"),Ge.innerHTML=An,Kt=n(),he=a("blockquote"),he.innerHTML=Nn,Yt=n(),q=a("div"),m(fe.$$.fragment),en=n(),Oe=a("p"),Oe.textContent=Gn,tn=n(),Ve=a("p"),Ve.innerHTML=On,nn=n(),G=a("div"),m(ge.$$.fragment),sn=n(),Je=a("p"),Je.textContent=Vn,an=n(),S=a("div"),m(ue.$$.fragment),on=n(),Ze=a("p"),Ze.textContent=Jn,rn=n(),Re=a("p"),Re.innerHTML=Zn,ln=n(),be=a("blockquote"),be.innerHTML=Rn,cn=n(),O=a("div"),m(ye.$$.fragment),pn=n(),We=a("p"),We.textContent=Wn,dn=n(),A=a("div"),m(ve.$$.fragment),mn=n(),ze=a("p"),ze.textContent=zn,hn=n(),Qe=a("p"),Qe.innerHTML=Qn,dt=n(),m(_e.$$.fragment),mt=n(),ot=a("p"),this.h()},l(t){const d=ss("svelte-u9bgzb",document.head);_=o(d,"META",{name:!0,content:!0}),d.forEach(c),W=s(t),k=o(t,"P",{}),v(k).forEach(c),H=s(t),h(F.$$.fragment,t),y=s(t),h(M.$$.fragment,t),it=s(t),z=o(t,"P",{"data-svelte-h":!0}),l(z)!=="svelte-em1lpf"&&(z.innerHTML=fn),lt=s(t),h(Q.$$.fragment,t),ct=s(t),X=o(t,"P",{"data-svelte-h":!0}),l(X)!=="svelte-1c4o3of"&&(X.innerHTML=gn),pt=s(t),r=o(t,"DIV",{class:!0});var i=v(r);h(B.$$.fragment,i),ut=s(i),xe=o(i,"P",{"data-svelte-h":!0}),l(xe)!=="svelte-xq4u8v"&&(xe.textContent=un),bt=s(i),$e=o(i,"BLOCKQUOTE",{"data-svelte-h":!0}),l($e)!=="svelte-tx5ac2"&&($e.innerHTML=bn),yt=s(i),h(N.$$.fragment,i),vt=s(i),He=o(i,"DIV",{class:!0});var Xn=v(He);h(K.$$.fragment,Xn),Xn.forEach(c),_t=s(i),L=o(i,"DIV",{class:!0});var Xe=v(L);h(Y.$$.fragment,Xe),xt=s(Xe),Fe=o(Xe,"P",{"data-svelte-h":!0}),l(Fe)!=="svelte-ygus26"&&(Fe.textContent=yn),$t=s(Xe),ee=o(Xe,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),l(ee)!=="svelte-1hehcdt"&&(ee.innerHTML=vn),Xe.forEach(c),Ht=s(i),w=o(i,"DIV",{class:!0});var V=v(w);h(te.$$.fragment,V),Ft=s(V),we=o(V,"P",{"data-svelte-h":!0}),l(we)!=="svelte-sh8nuo"&&(we.textContent=_n),wt=s(V),Ce=o(V,"P",{"data-svelte-h":!0}),l(Ce)!=="svelte-a15egh"&&(Ce.innerHTML=xn),Ct=s(V),ne=o(V,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),l(ne)!=="svelte-1sstd22"&&(ne.innerHTML=$n),V.forEach(c),Tt=s(i),D=o(i,"DIV",{class:!0});var Be=v(D);h(se.$$.fragment,Be),St=s(Be),Te=o(Be,"P",{"data-svelte-h":!0}),l(Te)!=="svelte-1ensbyu"&&(Te.textContent=Hn),Mt=s(Be),Se=o(Be,"P",{"data-svelte-h":!0}),l(Se)!=="svelte-1ic7msa"&&(Se.innerHTML=Fn),Be.forEach(c),kt=s(i),U=o(i,"DIV",{class:!0});var Ke=v(U);h(ae.$$.fragment,Ke),Lt=s(Ke),Me=o(Ke,"P",{"data-svelte-h":!0}),l(Me)!=="svelte-14g8wm7"&&(Me.textContent=wn),Dt=s(Ke),oe=o(Ke,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),l(oe)!=="svelte-i5yiay"&&(oe.innerHTML=Cn),Ke.forEach(c),Ut=s(i),P=o(i,"DIV",{class:!0});var Ye=v(P);h(re.$$.fragment,Ye),Pt=s(Ye),ke=o(Ye,"P",{"data-svelte-h":!0}),l(ke)!=="svelte-mro2r1"&&(ke.textContent=Tn),Et=s(Ye),Le=o(Ye,"P",{"data-svelte-h":!0}),l(Le)!=="svelte-kgqd2r"&&(Le.innerHTML=Sn),Ye.forEach(c),It=s(i),C=o(i,"DIV",{class:!0});var J=v(C);h(ie.$$.fragment,J),jt=s(J),De=o(J,"P",{"data-svelte-h":!0}),l(De)!=="svelte-vgg72e"&&(De.textContent=Mn),qt=s(J),Ue=o(J,"P",{"data-svelte-h":!0}),l(Ue)!=="svelte-izommx"&&(Ue.innerHTML=kn),At=s(J),le=o(J,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),l(le)!=="svelte-ze0w6l"&&(le.innerHTML=Ln),J.forEach(c),Nt=s(i),E=o(i,"DIV",{class:!0});var et=v(E);h(ce.$$.fragment,et),Gt=s(et),Pe=o(et,"P",{"data-svelte-h":!0}),l(Pe)!=="svelte-16j3ncy"&&(Pe.textContent=Dn),Ot=s(et),Ee=o(et,"P",{"data-svelte-h":!0}),l(Ee)!=="svelte-fqhl9"&&(Ee.innerHTML=Un),et.forEach(c),Vt=s(i),I=o(i,"DIV",{class:!0});var tt=v(I);h(pe.$$.fragment,tt),Jt=s(tt),Ie=o(tt,"P",{"data-svelte-h":!0}),l(Ie)!=="svelte-foylj9"&&(Ie.textContent=Pn),Zt=s(tt),je=o(tt,"P",{"data-svelte-h":!0}),l(je)!=="svelte-fz5g8s"&&(je.innerHTML=En),tt.forEach(c),Rt=s(i),j=o(i,"DIV",{class:!0});var nt=v(j);h(de.$$.fragment,nt),Wt=s(nt),qe=o(nt,"P",{"data-svelte-h":!0}),l(qe)!=="svelte-15gohlq"&&(qe.textContent=In),zt=s(nt),Ae=o(nt,"P",{"data-svelte-h":!0}),l(Ae)!=="svelte-1nd73z"&&(Ae.innerHTML=jn),nt.forEach(c),Qt=s(i),T=o(i,"DIV",{class:!0});var Z=v(T);h(me.$$.fragment,Z),Xt=s(Z),Ne=o(Z,"P",{"data-svelte-h":!0}),l(Ne)!=="svelte-f8hcny"&&(Ne.textContent=qn),Bt=s(Z),Ge=o(Z,"P",{"data-svelte-h":!0}),l(Ge)!=="svelte-17yp07o"&&(Ge.innerHTML=An),Kt=s(Z),he=o(Z,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),l(he)!=="svelte-1hchker"&&(he.innerHTML=Nn),Z.forEach(c),Yt=s(i),q=o(i,"DIV",{class:!0});var st=v(q);h(fe.$$.fragment,st),en=s(st),Oe=o(st,"P",{"data-svelte-h":!0}),l(Oe)!=="svelte-qb251l"&&(Oe.textContent=Gn),tn=s(st),Ve=o(st,"P",{"data-svelte-h":!0}),l(Ve)!=="svelte-14xy55m"&&(Ve.innerHTML=On),st.forEach(c),nn=s(i),G=o(i,"DIV",{class:!0});var ft=v(G);h(ge.$$.fragment,ft),sn=s(ft),Je=o(ft,"P",{"data-svelte-h":!0}),l(Je)!=="svelte-vfdh7r"&&(Je.textContent=Vn),ft.forEach(c),an=s(i),S=o(i,"DIV",{class:!0});var R=v(S);h(ue.$$.fragment,R),on=s(R),Ze=o(R,"P",{"data-svelte-h":!0}),l(Ze)!=="svelte-1b1nt2h"&&(Ze.textContent=Jn),rn=s(R),Re=o(R,"P",{"data-svelte-h":!0}),l(Re)!=="svelte-1m6txqs"&&(Re.innerHTML=Zn),ln=s(R),be=o(R,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),l(be)!=="svelte-1ugpdij"&&(be.innerHTML=Rn),R.forEach(c),cn=s(i),O=o(i,"DIV",{class:!0});var gt=v(O);h(ye.$$.fragment,gt),pn=s(gt),We=o(gt,"P",{"data-svelte-h":!0}),l(We)!=="svelte-150c7l4"&&(We.textContent=Wn),gt.forEach(c),dn=s(i),A=o(i,"DIV",{class:!0});var at=v(A);h(ve.$$.fragment,at),mn=s(at),ze=o(at,"P",{"data-svelte-h":!0}),l(ze)!=="svelte-jn2zhy"&&(ze.textContent=zn),hn=s(at),Qe=o(at,"P",{"data-svelte-h":!0}),l(Qe)!=="svelte-1bmm4rs"&&(Qe.innerHTML=Qn),at.forEach(c),i.forEach(c),dt=s(t),h(_e.$$.fragment,t),mt=s(t),ot=o(t,"P",{}),v(ot).forEach(c),this.h()},h(){p(_,"name","hf:doc:metadata"),p(_,"content",ps),p(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ee,"class","warning"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ne,"class","warning"),p(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(oe,"class","warning"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(le,"class","warning"),p(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(he,"class","warning"),p(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(be,"class","warning"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,d){e(document.head,_),$(t,W,d),$(t,k,d),$(t,H,d),f(F,t,d),$(t,y,d),f(M,t,d),$(t,it,d),$(t,z,d),$(t,lt,d),f(Q,t,d),$(t,ct,d),$(t,X,d),$(t,pt,d),$(t,r,d),f(B,r,null),e(r,ut),e(r,xe),e(r,bt),e(r,$e),e(r,yt),f(N,r,null),e(r,vt),e(r,He),f(K,He,null),e(r,_t),e(r,L),f(Y,L,null),e(L,xt),e(L,Fe),e(L,$t),e(L,ee),e(r,Ht),e(r,w),f(te,w,null),e(w,Ft),e(w,we),e(w,wt),e(w,Ce),e(w,Ct),e(w,ne),e(r,Tt),e(r,D),f(se,D,null),e(D,St),e(D,Te),e(D,Mt),e(D,Se),e(r,kt),e(r,U),f(ae,U,null),e(U,Lt),e(U,Me),e(U,Dt),e(U,oe),e(r,Ut),e(r,P),f(re,P,null),e(P,Pt),e(P,ke),e(P,Et),e(P,Le),e(r,It),e(r,C),f(ie,C,null),e(C,jt),e(C,De),e(C,qt),e(C,Ue),e(C,At),e(C,le),e(r,Nt),e(r,E),f(ce,E,null),e(E,Gt),e(E,Pe),e(E,Ot),e(E,Ee),e(r,Vt),e(r,I),f(pe,I,null),e(I,Jt),e(I,Ie),e(I,Zt),e(I,je),e(r,Rt),e(r,j),f(de,j,null),e(j,Wt),e(j,qe),e(j,zt),e(j,Ae),e(r,Qt),e(r,T),f(me,T,null),e(T,Xt),e(T,Ne),e(T,Bt),e(T,Ge),e(T,Kt),e(T,he),e(r,Yt),e(r,q),f(fe,q,null),e(q,en),e(q,Oe),e(q,tn),e(q,Ve),e(r,nn),e(r,G),f(ge,G,null),e(G,sn),e(G,Je),e(r,an),e(r,S),f(ue,S,null),e(S,on),e(S,Ze),e(S,rn),e(S,Re),e(S,ln),e(S,be),e(r,cn),e(r,O),f(ye,O,null),e(O,pn),e(O,We),e(r,dn),e(r,A),f(ve,A,null),e(A,mn),e(A,ze),e(A,hn),e(A,Qe),$(t,dt,d),f(_e,t,d),$(t,mt,d),$(t,ot,d),ht=!0},p(t,[d]){const i={};d&2&&(i.$$scope={dirty:d,ctx:t}),N.$set(i)},i(t){ht||(g(F.$$.fragment,t),g(M.$$.fragment,t),g(Q.$$.fragment,t),g(B.$$.fragment,t),g(N.$$.fragment,t),g(K.$$.fragment,t),g(Y.$$.fragment,t),g(te.$$.fragment,t),g(se.$$.fragment,t),g(ae.$$.fragment,t),g(re.$$.fragment,t),g(ie.$$.fragment,t),g(ce.$$.fragment,t),g(pe.$$.fragment,t),g(de.$$.fragment,t),g(me.$$.fragment,t),g(fe.$$.fragment,t),g(ge.$$.fragment,t),g(ue.$$.fragment,t),g(ye.$$.fragment,t),g(ve.$$.fragment,t),g(_e.$$.fragment,t),ht=!0)},o(t){u(F.$$.fragment,t),u(M.$$.fragment,t),u(Q.$$.fragment,t),u(B.$$.fragment,t),u(N.$$.fragment,t),u(K.$$.fragment,t),u(Y.$$.fragment,t),u(te.$$.fragment,t),u(se.$$.fragment,t),u(ae.$$.fragment,t),u(re.$$.fragment,t),u(ie.$$.fragment,t),u(ce.$$.fragment,t),u(pe.$$.fragment,t),u(de.$$.fragment,t),u(me.$$.fragment,t),u(fe.$$.fragment,t),u(ge.$$.fragment,t),u(ue.$$.fragment,t),u(ye.$$.fragment,t),u(ve.$$.fragment,t),u(_e.$$.fragment,t),ht=!1},d(t){t&&(c(W),c(k),c(H),c(y),c(it),c(z),c(lt),c(ct),c(X),c(pt),c(r),c(dt),c(mt),c(ot)),c(_),b(F,t),b(M,t),b(Q,t),b(B),b(N),b(K),b(Y),b(te),b(se),b(ae),b(re),b(ie),b(ce),b(pe),b(de),b(me),b(fe),b(ge),b(ue),b(ye),b(ve),b(_e,t)}}}const ps='{"title":"Filesystem API","local":"filesystem-api","sections":[{"title":"HfFileSystem","local":"huggingface_hub.HfFileSystem","sections":[],"depth":2}],"depth":1}';function ds(rt){return Yn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vs extends ts{constructor(_){super(),ns(this,_,ds,cs,Kn,{})}}export{vs as component};
