import{s as xa,o as Xa,n as Ca}from"../chunks/scheduler.6062bdaf.js";import{S as Ya,i as Ra,g as h,s as l,r as i,A as Ia,h as f,f as a,c as n,j as ka,u as r,x as m,k as Za,y as qa,a as s,v as o,d as p,t as c,w as g}from"../chunks/index.4bca734e.js";import{T as Ha}from"../chunks/Tip.b9ac1f03.js";import{C as d}from"../chunks/CodeBlock.fa01571c.js";import{H as $}from"../chunks/Heading.723dceba.js";function La(Xe){let u,b=`If you are used to working with platforms such as GitLab/GitHub/Bitbucket, your first instinct
might be to use <code>git</code> CLI to clone your repo (<code>git clone</code>), commit changes (<code>git add, git commit</code>) and push them
(<code>git push</code>). This is valid when using the Hugging Face Hub. However, software engineering and machine learning do
not share the same requirements and workflows. Model repositories might maintain large model weight files for different
frameworks and tools, so cloning the repository can lead to you maintaining large local folders with massive sizes. As
a result, it may be more efficient to use our custom HTTP methods. You can read our <a href="../concepts/git_vs_http">Git vs HTTP paradigm</a>
explanation page for more details.`;return{c(){u=h("p"),u.innerHTML=b},l(y){u=f(y,"P",{"data-svelte-h":!0}),m(u)!=="svelte-7thk71"&&(u.innerHTML=b)},m(y,w){s(y,u,w)},p:Ca,d(y){y&&a(u)}}}function Fa(Xe){let u,b='<a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/repository#huggingface_hub.Repository">Repository()</a> is deprecated in favor of the http-based alternatives implemented in <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi">HfApi</a>. Given its large adoption in legacy code, the complete removal of <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/repository#huggingface_hub.Repository">Repository()</a> will only happen in release <code>v1.0</code>. For more details, please read <a href="./concepts/git_vs_http">this explanation page</a>.';return{c(){u=h("p"),u.innerHTML=b},l(y){u=f(y,"P",{"data-svelte-h":!0}),m(u)!=="svelte-1puvt0m"&&(u.innerHTML=b)},m(y,w){s(y,u,w)},p:Ca,d(y){y&&a(u)}}}function Na(Xe){let u,b,y,w,v,Re,T,Et=`The Hugging Face Hub is a collection of git repositories. <a href="https://git-scm.com/" rel="nofollow">Git</a> is a widely used tool in software
development to easily version projects when working collaboratively. This guide will show you how to interact with the
repositories on the Hub, especially:`,Ie,j,Dt="<li>Create and delete a repository.</li> <li>Manage branches and tags.</li> <li>Rename your repository.</li> <li>Update your repository visibility.</li> <li>Manage a local copy of your repository.</li>",qe,_,Le,J,Kt=`If you want to create and manage a repository on the Hub, your machine must be logged in. If you are not, please refer to
<a href="../quick-start#login">this section</a>. In the rest of this guide, we will assume that your machine is logged in.`,Fe,U,Ne,G,Ot=`The first step is to know how to create and delete repositories. You can only manage repositories that you own (under
your username namespace) or from organizations in which you have write permissions.`,Be,k,We,Z,ea='Create an empty repository with <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.create_repo">create_repo()</a> and give it a name with the <code>repo_id</code> parameter. The <code>repo_id</code> is your namespace followed by the repository name: <code>username_or_org/repo_name</code>.',Se,H,Ve,C,ta='By default, <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.create_repo">create_repo()</a> creates a model repository. But you can use the <code>repo_type</code> parameter to specify another repository type. For example, if you want to create a dataset repository:',ze,x,Pe,X,aa="When you create a repository, you can set your repository visibility with the <code>private</code> parameter.",Qe,Y,Ae,R,sa='If you want to change the repository visibility at a later time, you can use the <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.update_repo_visibility">update_repo_visibility()</a> function.',Ee,I,De,q,la='Delete a repository with <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.delete_repo">delete_repo()</a>. Make sure you want to delete a repository because this is an irreversible process!',Ke,L,na="Specify the <code>repo_id</code> of the repository you want to delete:",Oe,F,et,N,tt,B,ia=`In some cases, you want to copy someone else’s repo to adapt it to your use case.
This is possible for Spaces using the <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.duplicate_space">duplicate_space()</a> method. It will duplicate the whole repository.
You will still need to configure your own settings (hardware, sleep-time, storage, variables and secrets). Check out our <a href="./manage-spaces">Manage your Space</a> guide for more details.`,at,W,st,S,lt,V,ra="Now that you have created your repository, you are interested in pushing changes to it and downloading files from it.",nt,z,oa=`These 2 topics deserve their own guides. Please refer to the <a href="./upload">upload</a> and the <a href="./download">download</a> guides
to learn how to use your repository.`,it,P,rt,Q,pa=`Git repositories often make use of branches to store different versions of a same repository.
Tags can also be used to flag a specific state of your repository, for example, when releasing a version.
More generally, branches and tags are referred as <a href="https://git-scm.com/book/en/v2/Git-Internals-Git-References" rel="nofollow">git references</a>.`,ot,A,pt,E,ca='You can create new branch and tags using <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.create_branch">create_branch()</a> and <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.create_tag">create_tag()</a>:',ct,D,gt,K,ga='You can use the <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.delete_branch">delete_branch()</a> and <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.delete_tag">delete_tag()</a> functions in the same way to delete a branch or a tag.',ht,O,ft,ee,ha='You can also list the existing git refs from a repository using <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.list_repo_refs">list_repo_refs()</a>:',mt,te,ut,ae,yt,se,fa=`Repositories come with some settings that you can configure. Most of the time, you will want to do that manually in the
repo settings page in your browser. You must have write access to a repo to configure it (either own it or being part of
an organization). In this section, we will see the settings that you can also configure programmatically using <code>huggingface_hub</code>.`,dt,le,ma='Some settings are specific to Spaces (hardware, environment variables,…). To configure those, please refer to our <a href="../guides/manage-spaces">Manage your Spaces</a> guide.',$t,ne,bt,ie,ua="A repository can be public or private. A private repository is only visible to you or members of the organization in which the repository is located. Change a repository to private as shown in the following:",wt,re,_t,oe,Mt,pe,ya=`You can rename your repository on the Hub using <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.move_repo">move_repo()</a>. Using this method, you can also move the repo from a user to
an organization. When doing so, there are a <a href="https://hf.co/docs/hub/repositories-settings#renaming-or-transferring-a-repo" rel="nofollow">few limitations</a>
that you should be aware of. For example, you can’t transfer your repo to another user.`,vt,ce,Tt,ge,jt,he,da=`All the actions described above can be done using HTTP requests. However, in some cases you might be interested in having
a local copy of your repository and interact with it using the Git commands you are familiar with.`,Jt,fe,$a='The <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/repository#huggingface_hub.Repository">Repository()</a> class allows you to interact with files and repositories on the Hub with functions similar to Git commands. It is a wrapper over Git and Git-LFS methods to use the Git commands you already know and love. Before starting, please make sure you have Git-LFS installed (see <a href="https://git-lfs.github.com/" rel="nofollow">here</a> for installation instructions).',Ut,M,Gt,me,kt,ue,ba='Instantiate a <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/repository#huggingface_hub.Repository">Repository()</a> object with a path to a local repository:',Zt,ye,Ht,de,Ct,$e,wa="The <code>clone_from</code> parameter clones a repository from a Hugging Face repository ID to a local directory specified by the <code>local_dir</code> argument:",xt,be,Xt,we,_a="<code>clone_from</code> can also clone a repository using a URL:",Yt,_e,Rt,Me,Ma='You can combine the <code>clone_from</code> parameter with <a href="/docs/huggingface_hub/v0.19.0.rc0/en/package_reference/hf_api#huggingface_hub.HfApi.create_repo">create_repo()</a> to create and clone a repository:',It,ve,qt,Te,va="You can also configure a Git username and email to a cloned repository by specifying the <code>git_user</code> and <code>git_email</code> parameters when you clone a repository. When users commit to that repository, Git will be aware of the commit author.",Lt,je,Ft,Je,Nt,Ue,Ta="Branches are important for collaboration and experimentation without impacting your current files and code. Switch between branches with <code>git_checkout()</code>. For example, if you want to switch from <code>branch1</code> to <code>branch2</code>:",Bt,Ge,Wt,ke,St,Ze,ja="<code>git_pull()</code> allows you to update a current local branch with changes from a remote repository:",Vt,He,zt,Ce,Ja="Set <code>rebase=True</code> if you want your local commits to occur after your branch is updated with the new commits from the remote:",Pt,xe,Qt,Ye,At;return v=new $({props:{title:"Create and manage a repository",local:"create-and-manage-a-repository",headingTag:"h1"}}),_=new Ha({props:{warning:!0,$$slots:{default:[La]},$$scope:{ctx:Xe}}}),U=new $({props:{title:"Repo creation and deletion",local:"repo-creation-and-deletion",headingTag:"h2"}}),k=new $({props:{title:"Create a repository",local:"create-a-repository",headingTag:"h3"}}),H=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGNyZWF0ZV9yZXBvJTBBY3JlYXRlX3JlcG8oJTIybHlzYW5kcmUlMkZ0ZXN0LW1vZGVsJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo
<span class="hljs-meta">&gt;&gt;&gt; </span>create_repo(<span class="hljs-string">&quot;lysandre/test-model&quot;</span>)
<span class="hljs-string">&#x27;https://huggingface.co/lysandre/test-model&#x27;</span>`,wrap:!1}}),x=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGNyZWF0ZV9yZXBvJTBBY3JlYXRlX3JlcG8oJTIybHlzYW5kcmUlMkZ0ZXN0LWRhdGFzZXQlMjIlMkMlMjByZXBvX3R5cGUlM0QlMjJkYXRhc2V0JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo
<span class="hljs-meta">&gt;&gt;&gt; </span>create_repo(<span class="hljs-string">&quot;lysandre/test-dataset&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)
<span class="hljs-string">&#x27;https://huggingface.co/datasets/lysandre/test-dataset&#x27;</span>`,wrap:!1}}),Y=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGNyZWF0ZV9yZXBvJTBBY3JlYXRlX3JlcG8oJTIybHlzYW5kcmUlMkZ0ZXN0LXByaXZhdGUlMjIlMkMlMjBwcml2YXRlJTNEVHJ1ZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo
<span class="hljs-meta">&gt;&gt;&gt; </span>create_repo(<span class="hljs-string">&quot;lysandre/test-private&quot;</span>, private=<span class="hljs-literal">True</span>)`,wrap:!1}}),I=new $({props:{title:"Delete a repository",local:"delete-a-repository",headingTag:"h3"}}),F=new d({props:{code:"ZGVsZXRlX3JlcG8ocmVwb19pZCUzRCUyMmx5c2FuZHJlJTJGbXktY29ycnVwdGVkLWRhdGFzZXQlMjIlMkMlMjByZXBvX3R5cGUlM0QlMjJkYXRhc2V0JTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>delete_repo(repo_id=<span class="hljs-string">&quot;lysandre/my-corrupted-dataset&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)',wrap:!1}}),N=new $({props:{title:"Duplicate a repository (only for Spaces)",local:"duplicate-a-repository-only-for-spaces",headingTag:"h3"}}),W=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGR1cGxpY2F0ZV9zcGFjZSUwQWR1cGxpY2F0ZV9zcGFjZSglMjJtdWx0aW1vZGFsYXJ0JTJGZHJlYW1ib290aC10cmFpbmluZyUyMiUyQyUyMHByaXZhdGUlM0RGYWxzZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> duplicate_space
<span class="hljs-meta">&gt;&gt;&gt; </span>duplicate_space(<span class="hljs-string">&quot;multimodalart/dreambooth-training&quot;</span>, private=<span class="hljs-literal">False</span>)
RepoUrl(<span class="hljs-string">&#x27;https://huggingface.co/spaces/nateraw/dreambooth-training&#x27;</span>,...)`,wrap:!1}}),S=new $({props:{title:"Upload and download files",local:"upload-and-download-files",headingTag:"h2"}}),P=new $({props:{title:"Branches and tags",local:"branches-and-tags",headingTag:"h2"}}),A=new $({props:{title:"Create branches and tags",local:"create-branches-and-tags",headingTag:"h3"}}),D=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGNyZWF0ZV9icmFuY2glMkMlMjBjcmVhdGVfdGFnJTBBJTBBY3JlYXRlX2JyYW5jaCglMjJNYXR0aGlqcyUyRnNwZWVjaHQ1LXR0cy1kZW1vJTIyJTJDJTIwcmVwb190eXBlJTNEJTIyc3BhY2UlMjIlMkMlMjBicmFuY2glM0QlMjJoYW5kbGUtZG9nLXNwZWFrZXIlMjIpJTBBJTBBY3JlYXRlX2JyYW5jaCglMjJiaWdjb2RlJTJGdGhlLXN0YWNrJTIyJTJDJTIwcmVwb190eXBlJTNEJTIyZGF0YXNldCUyMiUyQyUyMHJldmlzaW9uJTNEJTIydjAuMS1yZWxlYXNlJTIyJTJDJTIwdGFnJTNEJTIydjAuMS4xJTIyJTJDJTIwdGFnX21lc3NhZ2UlM0QlMjJCdW1wJTIwcmVsZWFzZSUyMHZlcnNpb24uJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_branch, create_tag

<span class="hljs-comment"># Create a branch on a Space repo from \`main\` branch</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>create_branch(<span class="hljs-string">&quot;Matthijs/speecht5-tts-demo&quot;</span>, repo_type=<span class="hljs-string">&quot;space&quot;</span>, branch=<span class="hljs-string">&quot;handle-dog-speaker&quot;</span>)

<span class="hljs-comment"># Create a tag on a Dataset repo from \`v0.1-release\` branch</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>create_branch(<span class="hljs-string">&quot;bigcode/the-stack&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>, revision=<span class="hljs-string">&quot;v0.1-release&quot;</span>, tag=<span class="hljs-string">&quot;v0.1.1&quot;</span>, tag_message=<span class="hljs-string">&quot;Bump release version.&quot;</span>)`,wrap:!1}}),O=new $({props:{title:"List all branches and tags",local:"list-all-branches-and-tags",headingTag:"h3"}}),te=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxpc3RfcmVwb19yZWZzJTBBbGlzdF9yZXBvX3JlZnMoJTIyYmlnY29kZSUyRnRoZS1zdGFjayUyMiUyQyUyMHJlcG9fdHlwZSUzRCUyMmRhdGFzZXQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_repo_refs
<span class="hljs-meta">&gt;&gt;&gt; </span>list_repo_refs(<span class="hljs-string">&quot;bigcode/the-stack&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)
GitRefs(
   branches=[
         GitRefInfo(name=<span class="hljs-string">&#x27;main&#x27;</span>, ref=<span class="hljs-string">&#x27;refs/heads/main&#x27;</span>, target_commit=<span class="hljs-string">&#x27;18edc1591d9ce72aa82f56c4431b3c969b210ae3&#x27;</span>),
         GitRefInfo(name=<span class="hljs-string">&#x27;v1.1.a1&#x27;</span>, ref=<span class="hljs-string">&#x27;refs/heads/v1.1.a1&#x27;</span>, target_commit=<span class="hljs-string">&#x27;f9826b862d1567f3822d3d25649b0d6d22ace714&#x27;</span>)
   ],
   converts=[],
   tags=[
         GitRefInfo(name=<span class="hljs-string">&#x27;v1.0&#x27;</span>, ref=<span class="hljs-string">&#x27;refs/tags/v1.0&#x27;</span>, target_commit=<span class="hljs-string">&#x27;c37a8cd1e382064d8aced5e05543c5f7753834da&#x27;</span>)
   ]
)`,wrap:!1}}),ae=new $({props:{title:"Change repository settings",local:"change-repository-settings",headingTag:"h2"}}),ne=new $({props:{title:"Update visibility",local:"update-visibility",headingTag:"h3"}}),re=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHVwZGF0ZV9yZXBvX3Zpc2liaWxpdHklMEF1cGRhdGVfcmVwb192aXNpYmlsaXR5KHJlcG9faWQlM0RyZXBvX2lkJTJDJTIwcHJpdmF0ZSUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> update_repo_visibility
<span class="hljs-meta">&gt;&gt;&gt; </span>update_repo_visibility(repo_id=repo_id, private=<span class="hljs-literal">True</span>)`,wrap:!1}}),oe=new $({props:{title:"Rename your repository",local:"rename-your-repository",headingTag:"h3"}}),ce=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG1vdmVfcmVwbyUwQW1vdmVfcmVwbyhmcm9tX2lkJTNEJTIyV2F1cGxpbiUyRmNvb2wtbW9kZWwlMjIlMkMlMjB0b19pZCUzRCUyMmh1Z2dpbmdmYWNlJTJGY29vbC1tb2RlbCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> move_repo
<span class="hljs-meta">&gt;&gt;&gt; </span>move_repo(from_id=<span class="hljs-string">&quot;Wauplin/cool-model&quot;</span>, to_id=<span class="hljs-string">&quot;huggingface/cool-model&quot;</span>)`,wrap:!1}}),ge=new $({props:{title:"Manage a local copy of your repository",local:"manage-a-local-copy-of-your-repository",headingTag:"h2"}}),M=new Ha({props:{warning:!0,$$slots:{default:[Fa]},$$scope:{ctx:Xe}}}),me=new $({props:{title:"Use a local repository",local:"use-a-local-repository",headingTag:"h3"}}),ye=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMFJlcG9zaXRvcnklMEFyZXBvJTIwJTNEJTIwUmVwb3NpdG9yeShsb2NhbF9kaXIlM0QlMjIlM0NwYXRoJTNFJTJGJTNDdG8lM0UlMkYlM0Nmb2xkZXIlM0UlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository
<span class="hljs-meta">&gt;&gt;&gt; </span>repo = Repository(local_dir=<span class="hljs-string">&quot;&lt;path&gt;/&lt;to&gt;/&lt;folder&gt;&quot;</span>)`,wrap:!1}}),de=new $({props:{title:"Clone",local:"clone",headingTag:"h3"}}),be=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMFJlcG9zaXRvcnklMEFyZXBvJTIwJTNEJTIwUmVwb3NpdG9yeShsb2NhbF9kaXIlM0QlMjJ3MnYyJTIyJTJDJTIwY2xvbmVfZnJvbSUzRCUyMmZhY2Vib29rJTJGd2F2MnZlYzItbGFyZ2UtOTYwaC1sdjYwJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository
<span class="hljs-meta">&gt;&gt;&gt; </span>repo = Repository(local_dir=<span class="hljs-string">&quot;w2v2&quot;</span>, clone_from=<span class="hljs-string">&quot;facebook/wav2vec2-large-960h-lv60&quot;</span>)`,wrap:!1}}),_e=new d({props:{code:"cmVwbyUyMCUzRCUyMFJlcG9zaXRvcnkobG9jYWxfZGlyJTNEJTIyaHVnZ2luZ2ZhY2UtaHViJTIyJTJDJTIwY2xvbmVfZnJvbSUzRCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZmYWNlYm9vayUyRndhdjJ2ZWMyLWxhcmdlLTk2MGgtbHY2MCUyMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>repo = Repository(local_dir=<span class="hljs-string">&quot;huggingface-hub&quot;</span>, clone_from=<span class="hljs-string">&quot;https://huggingface.co/facebook/wav2vec2-large-960h-lv60&quot;</span>)',wrap:!1}}),ve=new d({props:{code:"cmVwb191cmwlMjAlM0QlMjBjcmVhdGVfcmVwbyhyZXBvX2lkJTNEJTIycmVwb19uYW1lJTIyKSUwQXJlcG8lMjAlM0QlMjBSZXBvc2l0b3J5KGxvY2FsX2RpciUzRCUyMnJlcG9fbG9jYWxfcGF0aCUyMiUyQyUyMGNsb25lX2Zyb20lM0RyZXBvX3VybCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>repo_url = create_repo(repo_id=<span class="hljs-string">&quot;repo_name&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>repo = Repository(local_dir=<span class="hljs-string">&quot;repo_local_path&quot;</span>, clone_from=repo_url)`,wrap:!1}}),je=new d({props:{code:"cmVwbyUyMCUzRCUyMFJlcG9zaXRvcnkoJTBBJTIwJTIwJTIybXktZGF0YXNldCUyMiUyQyUwQSUyMCUyMGNsb25lX2Zyb20lM0QlMjIlM0N1c2VyJTNFJTJGJTNDZGF0YXNldF9pZCUzRSUyMiUyQyUwQSUyMCUyMHRva2VuJTNEVHJ1ZSUyQyUwQSUyMCUyMHJlcG9fdHlwZSUzRCUyMmRhdGFzZXQlMjIlMkMlMEElMjAlMjBnaXRfdXNlciUzRCUyMk15TmFtZSUyMiUyQyUwQSUyMCUyMGdpdF9lbWFpbCUzRCUyMm1lJTQwY29vbC5tYWlsJTIyJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>repo = Repository(
<span class="hljs-meta">... </span>  <span class="hljs-string">&quot;my-dataset&quot;</span>,
<span class="hljs-meta">... </span>  clone_from=<span class="hljs-string">&quot;&lt;user&gt;/&lt;dataset_id&gt;&quot;</span>,
<span class="hljs-meta">... </span>  token=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>  repo_type=<span class="hljs-string">&quot;dataset&quot;</span>,
<span class="hljs-meta">... </span>  git_user=<span class="hljs-string">&quot;MyName&quot;</span>,
<span class="hljs-meta">... </span>  git_email=<span class="hljs-string">&quot;me@cool.mail&quot;</span>
<span class="hljs-meta">... </span>)`,wrap:!1}}),Je=new $({props:{title:"Branch",local:"branch",headingTag:"h3"}}),Ge=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMFJlcG9zaXRvcnklMEFyZXBvJTIwJTNEJTIwUmVwb3NpdG9yeShsb2NhbF9kaXIlM0QlMjJodWdnaW5nZmFjZS1odWIlMjIlMkMlMjBjbG9uZV9mcm9tJTNEJTIyJTNDdXNlciUzRSUyRiUzQ2RhdGFzZXRfaWQlM0UlMjIlMkMlMjByZXZpc2lvbiUzRCdicmFuY2gxJyklMEFyZXBvLmdpdF9jaGVja291dCglMjJicmFuY2gyJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository
<span class="hljs-meta">&gt;&gt;&gt; </span>repo = Repository(local_dir=<span class="hljs-string">&quot;huggingface-hub&quot;</span>, clone_from=<span class="hljs-string">&quot;&lt;user&gt;/&lt;dataset_id&gt;&quot;</span>, revision=<span class="hljs-string">&#x27;branch1&#x27;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>repo.git_checkout(<span class="hljs-string">&quot;branch2&quot;</span>)`,wrap:!1}}),ke=new $({props:{title:"Pull",local:"pull",headingTag:"h3"}}),He=new d({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMFJlcG9zaXRvcnklMEFyZXBvLmdpdF9wdWxsKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository
<span class="hljs-meta">&gt;&gt;&gt; </span>repo.git_pull()`,wrap:!1}}),xe=new d({props:{code:"cmVwby5naXRfcHVsbChyZWJhc2UlM0RUcnVlKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>repo.git_pull(rebase=<span class="hljs-literal">True</span>)',wrap:!1}}),{c(){u=h("meta"),b=l(),y=h("p"),w=l(),i(v.$$.fragment),Re=l(),T=h("p"),T.innerHTML=Et,Ie=l(),j=h("ul"),j.innerHTML=Dt,qe=l(),i(_.$$.fragment),Le=l(),J=h("p"),J.innerHTML=Kt,Fe=l(),i(U.$$.fragment),Ne=l(),G=h("p"),G.textContent=Ot,Be=l(),i(k.$$.fragment),We=l(),Z=h("p"),Z.innerHTML=ea,Se=l(),i(H.$$.fragment),Ve=l(),C=h("p"),C.innerHTML=ta,ze=l(),i(x.$$.fragment),Pe=l(),X=h("p"),X.innerHTML=aa,Qe=l(),i(Y.$$.fragment),Ae=l(),R=h("p"),R.innerHTML=sa,Ee=l(),i(I.$$.fragment),De=l(),q=h("p"),q.innerHTML=la,Ke=l(),L=h("p"),L.innerHTML=na,Oe=l(),i(F.$$.fragment),et=l(),i(N.$$.fragment),tt=l(),B=h("p"),B.innerHTML=ia,at=l(),i(W.$$.fragment),st=l(),i(S.$$.fragment),lt=l(),V=h("p"),V.textContent=ra,nt=l(),z=h("p"),z.innerHTML=oa,it=l(),i(P.$$.fragment),rt=l(),Q=h("p"),Q.innerHTML=pa,ot=l(),i(A.$$.fragment),pt=l(),E=h("p"),E.innerHTML=ca,ct=l(),i(D.$$.fragment),gt=l(),K=h("p"),K.innerHTML=ga,ht=l(),i(O.$$.fragment),ft=l(),ee=h("p"),ee.innerHTML=ha,mt=l(),i(te.$$.fragment),ut=l(),i(ae.$$.fragment),yt=l(),se=h("p"),se.innerHTML=fa,dt=l(),le=h("p"),le.innerHTML=ma,$t=l(),i(ne.$$.fragment),bt=l(),ie=h("p"),ie.textContent=ua,wt=l(),i(re.$$.fragment),_t=l(),i(oe.$$.fragment),Mt=l(),pe=h("p"),pe.innerHTML=ya,vt=l(),i(ce.$$.fragment),Tt=l(),i(ge.$$.fragment),jt=l(),he=h("p"),he.textContent=da,Jt=l(),fe=h("p"),fe.innerHTML=$a,Ut=l(),i(M.$$.fragment),Gt=l(),i(me.$$.fragment),kt=l(),ue=h("p"),ue.innerHTML=ba,Zt=l(),i(ye.$$.fragment),Ht=l(),i(de.$$.fragment),Ct=l(),$e=h("p"),$e.innerHTML=wa,xt=l(),i(be.$$.fragment),Xt=l(),we=h("p"),we.innerHTML=_a,Yt=l(),i(_e.$$.fragment),Rt=l(),Me=h("p"),Me.innerHTML=Ma,It=l(),i(ve.$$.fragment),qt=l(),Te=h("p"),Te.innerHTML=va,Lt=l(),i(je.$$.fragment),Ft=l(),i(Je.$$.fragment),Nt=l(),Ue=h("p"),Ue.innerHTML=Ta,Bt=l(),i(Ge.$$.fragment),Wt=l(),i(ke.$$.fragment),St=l(),Ze=h("p"),Ze.innerHTML=ja,Vt=l(),i(He.$$.fragment),zt=l(),Ce=h("p"),Ce.innerHTML=Ja,Pt=l(),i(xe.$$.fragment),Qt=l(),Ye=h("p"),this.h()},l(e){const t=Ia("svelte-u9bgzb",document.head);u=f(t,"META",{name:!0,content:!0}),t.forEach(a),b=n(e),y=f(e,"P",{}),ka(y).forEach(a),w=n(e),r(v.$$.fragment,e),Re=n(e),T=f(e,"P",{"data-svelte-h":!0}),m(T)!=="svelte-15r6soe"&&(T.innerHTML=Et),Ie=n(e),j=f(e,"UL",{"data-svelte-h":!0}),m(j)!=="svelte-zmlzlm"&&(j.innerHTML=Dt),qe=n(e),r(_.$$.fragment,e),Le=n(e),J=f(e,"P",{"data-svelte-h":!0}),m(J)!=="svelte-ybftem"&&(J.innerHTML=Kt),Fe=n(e),r(U.$$.fragment,e),Ne=n(e),G=f(e,"P",{"data-svelte-h":!0}),m(G)!=="svelte-1yl5xsc"&&(G.textContent=Ot),Be=n(e),r(k.$$.fragment,e),We=n(e),Z=f(e,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-gebbl1"&&(Z.innerHTML=ea),Se=n(e),r(H.$$.fragment,e),Ve=n(e),C=f(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-9fbxa9"&&(C.innerHTML=ta),ze=n(e),r(x.$$.fragment,e),Pe=n(e),X=f(e,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1lhlim8"&&(X.innerHTML=aa),Qe=n(e),r(Y.$$.fragment,e),Ae=n(e),R=f(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-1tjpuop"&&(R.innerHTML=sa),Ee=n(e),r(I.$$.fragment,e),De=n(e),q=f(e,"P",{"data-svelte-h":!0}),m(q)!=="svelte-19gylt9"&&(q.innerHTML=la),Ke=n(e),L=f(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-130g6n6"&&(L.innerHTML=na),Oe=n(e),r(F.$$.fragment,e),et=n(e),r(N.$$.fragment,e),tt=n(e),B=f(e,"P",{"data-svelte-h":!0}),m(B)!=="svelte-1ewps06"&&(B.innerHTML=ia),at=n(e),r(W.$$.fragment,e),st=n(e),r(S.$$.fragment,e),lt=n(e),V=f(e,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1sdwkqa"&&(V.textContent=ra),nt=n(e),z=f(e,"P",{"data-svelte-h":!0}),m(z)!=="svelte-1sqatlx"&&(z.innerHTML=oa),it=n(e),r(P.$$.fragment,e),rt=n(e),Q=f(e,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-1rc0mjs"&&(Q.innerHTML=pa),ot=n(e),r(A.$$.fragment,e),pt=n(e),E=f(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-yicfxa"&&(E.innerHTML=ca),ct=n(e),r(D.$$.fragment,e),gt=n(e),K=f(e,"P",{"data-svelte-h":!0}),m(K)!=="svelte-xwsz63"&&(K.innerHTML=ga),ht=n(e),r(O.$$.fragment,e),ft=n(e),ee=f(e,"P",{"data-svelte-h":!0}),m(ee)!=="svelte-18gbm9y"&&(ee.innerHTML=ha),mt=n(e),r(te.$$.fragment,e),ut=n(e),r(ae.$$.fragment,e),yt=n(e),se=f(e,"P",{"data-svelte-h":!0}),m(se)!=="svelte-1nx84sp"&&(se.innerHTML=fa),dt=n(e),le=f(e,"P",{"data-svelte-h":!0}),m(le)!=="svelte-16vpsz9"&&(le.innerHTML=ma),$t=n(e),r(ne.$$.fragment,e),bt=n(e),ie=f(e,"P",{"data-svelte-h":!0}),m(ie)!=="svelte-17yd1o0"&&(ie.textContent=ua),wt=n(e),r(re.$$.fragment,e),_t=n(e),r(oe.$$.fragment,e),Mt=n(e),pe=f(e,"P",{"data-svelte-h":!0}),m(pe)!=="svelte-1x54nyw"&&(pe.innerHTML=ya),vt=n(e),r(ce.$$.fragment,e),Tt=n(e),r(ge.$$.fragment,e),jt=n(e),he=f(e,"P",{"data-svelte-h":!0}),m(he)!=="svelte-y0ecwu"&&(he.textContent=da),Jt=n(e),fe=f(e,"P",{"data-svelte-h":!0}),m(fe)!=="svelte-1aw1xjl"&&(fe.innerHTML=$a),Ut=n(e),r(M.$$.fragment,e),Gt=n(e),r(me.$$.fragment,e),kt=n(e),ue=f(e,"P",{"data-svelte-h":!0}),m(ue)!=="svelte-618t4z"&&(ue.innerHTML=ba),Zt=n(e),r(ye.$$.fragment,e),Ht=n(e),r(de.$$.fragment,e),Ct=n(e),$e=f(e,"P",{"data-svelte-h":!0}),m($e)!=="svelte-1efx20p"&&($e.innerHTML=wa),xt=n(e),r(be.$$.fragment,e),Xt=n(e),we=f(e,"P",{"data-svelte-h":!0}),m(we)!=="svelte-1kdxyrq"&&(we.innerHTML=_a),Yt=n(e),r(_e.$$.fragment,e),Rt=n(e),Me=f(e,"P",{"data-svelte-h":!0}),m(Me)!=="svelte-g0lqo4"&&(Me.innerHTML=Ma),It=n(e),r(ve.$$.fragment,e),qt=n(e),Te=f(e,"P",{"data-svelte-h":!0}),m(Te)!=="svelte-2rn2fx"&&(Te.innerHTML=va),Lt=n(e),r(je.$$.fragment,e),Ft=n(e),r(Je.$$.fragment,e),Nt=n(e),Ue=f(e,"P",{"data-svelte-h":!0}),m(Ue)!=="svelte-bq7jn5"&&(Ue.innerHTML=Ta),Bt=n(e),r(Ge.$$.fragment,e),Wt=n(e),r(ke.$$.fragment,e),St=n(e),Ze=f(e,"P",{"data-svelte-h":!0}),m(Ze)!=="svelte-3u7mf8"&&(Ze.innerHTML=ja),Vt=n(e),r(He.$$.fragment,e),zt=n(e),Ce=f(e,"P",{"data-svelte-h":!0}),m(Ce)!=="svelte-199y79p"&&(Ce.innerHTML=Ja),Pt=n(e),r(xe.$$.fragment,e),Qt=n(e),Ye=f(e,"P",{}),ka(Ye).forEach(a),this.h()},h(){Za(u,"name","hf:doc:metadata"),Za(u,"content",Ba)},m(e,t){qa(document.head,u),s(e,b,t),s(e,y,t),s(e,w,t),o(v,e,t),s(e,Re,t),s(e,T,t),s(e,Ie,t),s(e,j,t),s(e,qe,t),o(_,e,t),s(e,Le,t),s(e,J,t),s(e,Fe,t),o(U,e,t),s(e,Ne,t),s(e,G,t),s(e,Be,t),o(k,e,t),s(e,We,t),s(e,Z,t),s(e,Se,t),o(H,e,t),s(e,Ve,t),s(e,C,t),s(e,ze,t),o(x,e,t),s(e,Pe,t),s(e,X,t),s(e,Qe,t),o(Y,e,t),s(e,Ae,t),s(e,R,t),s(e,Ee,t),o(I,e,t),s(e,De,t),s(e,q,t),s(e,Ke,t),s(e,L,t),s(e,Oe,t),o(F,e,t),s(e,et,t),o(N,e,t),s(e,tt,t),s(e,B,t),s(e,at,t),o(W,e,t),s(e,st,t),o(S,e,t),s(e,lt,t),s(e,V,t),s(e,nt,t),s(e,z,t),s(e,it,t),o(P,e,t),s(e,rt,t),s(e,Q,t),s(e,ot,t),o(A,e,t),s(e,pt,t),s(e,E,t),s(e,ct,t),o(D,e,t),s(e,gt,t),s(e,K,t),s(e,ht,t),o(O,e,t),s(e,ft,t),s(e,ee,t),s(e,mt,t),o(te,e,t),s(e,ut,t),o(ae,e,t),s(e,yt,t),s(e,se,t),s(e,dt,t),s(e,le,t),s(e,$t,t),o(ne,e,t),s(e,bt,t),s(e,ie,t),s(e,wt,t),o(re,e,t),s(e,_t,t),o(oe,e,t),s(e,Mt,t),s(e,pe,t),s(e,vt,t),o(ce,e,t),s(e,Tt,t),o(ge,e,t),s(e,jt,t),s(e,he,t),s(e,Jt,t),s(e,fe,t),s(e,Ut,t),o(M,e,t),s(e,Gt,t),o(me,e,t),s(e,kt,t),s(e,ue,t),s(e,Zt,t),o(ye,e,t),s(e,Ht,t),o(de,e,t),s(e,Ct,t),s(e,$e,t),s(e,xt,t),o(be,e,t),s(e,Xt,t),s(e,we,t),s(e,Yt,t),o(_e,e,t),s(e,Rt,t),s(e,Me,t),s(e,It,t),o(ve,e,t),s(e,qt,t),s(e,Te,t),s(e,Lt,t),o(je,e,t),s(e,Ft,t),o(Je,e,t),s(e,Nt,t),s(e,Ue,t),s(e,Bt,t),o(Ge,e,t),s(e,Wt,t),o(ke,e,t),s(e,St,t),s(e,Ze,t),s(e,Vt,t),o(He,e,t),s(e,zt,t),s(e,Ce,t),s(e,Pt,t),o(xe,e,t),s(e,Qt,t),s(e,Ye,t),At=!0},p(e,[t]){const Ua={};t&2&&(Ua.$$scope={dirty:t,ctx:e}),_.$set(Ua);const Ga={};t&2&&(Ga.$$scope={dirty:t,ctx:e}),M.$set(Ga)},i(e){At||(p(v.$$.fragment,e),p(_.$$.fragment,e),p(U.$$.fragment,e),p(k.$$.fragment,e),p(H.$$.fragment,e),p(x.$$.fragment,e),p(Y.$$.fragment,e),p(I.$$.fragment,e),p(F.$$.fragment,e),p(N.$$.fragment,e),p(W.$$.fragment,e),p(S.$$.fragment,e),p(P.$$.fragment,e),p(A.$$.fragment,e),p(D.$$.fragment,e),p(O.$$.fragment,e),p(te.$$.fragment,e),p(ae.$$.fragment,e),p(ne.$$.fragment,e),p(re.$$.fragment,e),p(oe.$$.fragment,e),p(ce.$$.fragment,e),p(ge.$$.fragment,e),p(M.$$.fragment,e),p(me.$$.fragment,e),p(ye.$$.fragment,e),p(de.$$.fragment,e),p(be.$$.fragment,e),p(_e.$$.fragment,e),p(ve.$$.fragment,e),p(je.$$.fragment,e),p(Je.$$.fragment,e),p(Ge.$$.fragment,e),p(ke.$$.fragment,e),p(He.$$.fragment,e),p(xe.$$.fragment,e),At=!0)},o(e){c(v.$$.fragment,e),c(_.$$.fragment,e),c(U.$$.fragment,e),c(k.$$.fragment,e),c(H.$$.fragment,e),c(x.$$.fragment,e),c(Y.$$.fragment,e),c(I.$$.fragment,e),c(F.$$.fragment,e),c(N.$$.fragment,e),c(W.$$.fragment,e),c(S.$$.fragment,e),c(P.$$.fragment,e),c(A.$$.fragment,e),c(D.$$.fragment,e),c(O.$$.fragment,e),c(te.$$.fragment,e),c(ae.$$.fragment,e),c(ne.$$.fragment,e),c(re.$$.fragment,e),c(oe.$$.fragment,e),c(ce.$$.fragment,e),c(ge.$$.fragment,e),c(M.$$.fragment,e),c(me.$$.fragment,e),c(ye.$$.fragment,e),c(de.$$.fragment,e),c(be.$$.fragment,e),c(_e.$$.fragment,e),c(ve.$$.fragment,e),c(je.$$.fragment,e),c(Je.$$.fragment,e),c(Ge.$$.fragment,e),c(ke.$$.fragment,e),c(He.$$.fragment,e),c(xe.$$.fragment,e),At=!1},d(e){e&&(a(b),a(y),a(w),a(Re),a(T),a(Ie),a(j),a(qe),a(Le),a(J),a(Fe),a(Ne),a(G),a(Be),a(We),a(Z),a(Se),a(Ve),a(C),a(ze),a(Pe),a(X),a(Qe),a(Ae),a(R),a(Ee),a(De),a(q),a(Ke),a(L),a(Oe),a(et),a(tt),a(B),a(at),a(st),a(lt),a(V),a(nt),a(z),a(it),a(rt),a(Q),a(ot),a(pt),a(E),a(ct),a(gt),a(K),a(ht),a(ft),a(ee),a(mt),a(ut),a(yt),a(se),a(dt),a(le),a($t),a(bt),a(ie),a(wt),a(_t),a(Mt),a(pe),a(vt),a(Tt),a(jt),a(he),a(Jt),a(fe),a(Ut),a(Gt),a(kt),a(ue),a(Zt),a(Ht),a(Ct),a($e),a(xt),a(Xt),a(we),a(Yt),a(Rt),a(Me),a(It),a(qt),a(Te),a(Lt),a(Ft),a(Nt),a(Ue),a(Bt),a(Wt),a(St),a(Ze),a(Vt),a(zt),a(Ce),a(Pt),a(Qt),a(Ye)),a(u),g(v,e),g(_,e),g(U,e),g(k,e),g(H,e),g(x,e),g(Y,e),g(I,e),g(F,e),g(N,e),g(W,e),g(S,e),g(P,e),g(A,e),g(D,e),g(O,e),g(te,e),g(ae,e),g(ne,e),g(re,e),g(oe,e),g(ce,e),g(ge,e),g(M,e),g(me,e),g(ye,e),g(de,e),g(be,e),g(_e,e),g(ve,e),g(je,e),g(Je,e),g(Ge,e),g(ke,e),g(He,e),g(xe,e)}}}const Ba='{"title":"Create and manage a repository","local":"create-and-manage-a-repository","sections":[{"title":"Repo creation and deletion","local":"repo-creation-and-deletion","sections":[{"title":"Create a repository","local":"create-a-repository","sections":[],"depth":3},{"title":"Delete a repository","local":"delete-a-repository","sections":[],"depth":3},{"title":"Duplicate a repository (only for Spaces)","local":"duplicate-a-repository-only-for-spaces","sections":[],"depth":3}],"depth":2},{"title":"Upload and download files","local":"upload-and-download-files","sections":[],"depth":2},{"title":"Branches and tags","local":"branches-and-tags","sections":[{"title":"Create branches and tags","local":"create-branches-and-tags","sections":[],"depth":3},{"title":"List all branches and tags","local":"list-all-branches-and-tags","sections":[],"depth":3}],"depth":2},{"title":"Change repository settings","local":"change-repository-settings","sections":[{"title":"Update visibility","local":"update-visibility","sections":[],"depth":3},{"title":"Rename your repository","local":"rename-your-repository","sections":[],"depth":3}],"depth":2},{"title":"Manage a local copy of your repository","local":"manage-a-local-copy-of-your-repository","sections":[{"title":"Use a local repository","local":"use-a-local-repository","sections":[],"depth":3},{"title":"Clone","local":"clone","sections":[],"depth":3},{"title":"Branch","local":"branch","sections":[],"depth":3},{"title":"Pull","local":"pull","sections":[],"depth":3}],"depth":2}],"depth":1}';function Wa(Xe){return Xa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Aa extends Ya{constructor(u){super(),Ra(this,u,Wa,Na,xa,{})}}export{Aa as component};
