import{s as xa,o as Xa,n as Ca}from"../chunks/scheduler.6062bdaf.js";import{S as Ra,i as Ya,g as h,s as n,r as i,A as Ia,h as m,f as a,c as l,j as ka,u as r,x as f,k as Za,y as La,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 qa(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=m(y,"P",{"data-svelte-h":!0}),f(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/main/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/main/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/main/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=m(y,"P",{"data-svelte-h":!0}),f(u)!=="svelte-20ypic"&&(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,Ye,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>",Le,_,qe,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#authentication">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/main/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,ze,C,ta='By default, <a href="/docs/huggingface_hub/main/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:',Ve,x,Pe,X,aa="When you create a repository, you can set your repository visibility with the <code>private</code> parameter.",Qe,R,Ae,Y,sa='If you want to change the repository visibility at a later time, you can use the <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_repo_visibility">update_repo_visibility()</a> function.',Ee,I,De,L,na='Delete a repository with <a href="/docs/huggingface_hub/main/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,q,la="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/main/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,nt,z,ra="Now that you have created your repository, you are interested in pushing changes to it and downloading files from it.",lt,V,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/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_branch">create_branch()</a> and <a href="/docs/huggingface_hub/main/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/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_branch">delete_branch()</a> and <a href="/docs/huggingface_hub/main/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,mt,ee,ha='You can also list the existing git refs from a repository using <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.list_repo_refs">list_repo_refs()</a>:',ft,te,ut,ae,yt,se,ma=`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,ne,fa='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,le,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/main/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,me,$a='The <a href="/docs/huggingface_hub/main/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,fe,kt,ue,ba='Instantiate a <a href="/docs/huggingface_hub/main/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:",Rt,_e,Yt,Me,Ma='You can combine the <code>clone_from</code> parameter with <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_repo">create_repo()</a> to create and clone a repository:',It,ve,Lt,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.",qt,je,Ft,Je,Nt,Ue,Ta='Branches are important for collaboration and experimentation without impacting your current files and code. Switch between branches with <a href="/docs/huggingface_hub/main/en/package_reference/repository#huggingface_hub.Repository.git_checkout">git_checkout()</a>. For example, if you want to switch from <code>branch1</code> to <code>branch2</code>:',Bt,Ge,Wt,ke,St,Ze,ja='<a href="/docs/huggingface_hub/main/en/package_reference/repository#huggingface_hub.Repository.git_pull">git_pull()</a> allows you to update a current local branch with changes from a remote repository:',zt,He,Vt,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,Re,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:[qa]},$$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}}),R=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"}}),le=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}}}),fe=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=n(),y=h("p"),w=n(),i(v.$$.fragment),Ye=n(),T=h("p"),T.innerHTML=Et,Ie=n(),j=h("ul"),j.innerHTML=Dt,Le=n(),i(_.$$.fragment),qe=n(),J=h("p"),J.innerHTML=Kt,Fe=n(),i(U.$$.fragment),Ne=n(),G=h("p"),G.textContent=Ot,Be=n(),i(k.$$.fragment),We=n(),Z=h("p"),Z.innerHTML=ea,Se=n(),i(H.$$.fragment),ze=n(),C=h("p"),C.innerHTML=ta,Ve=n(),i(x.$$.fragment),Pe=n(),X=h("p"),X.innerHTML=aa,Qe=n(),i(R.$$.fragment),Ae=n(),Y=h("p"),Y.innerHTML=sa,Ee=n(),i(I.$$.fragment),De=n(),L=h("p"),L.innerHTML=na,Ke=n(),q=h("p"),q.innerHTML=la,Oe=n(),i(F.$$.fragment),et=n(),i(N.$$.fragment),tt=n(),B=h("p"),B.innerHTML=ia,at=n(),i(W.$$.fragment),st=n(),i(S.$$.fragment),nt=n(),z=h("p"),z.textContent=ra,lt=n(),V=h("p"),V.innerHTML=oa,it=n(),i(P.$$.fragment),rt=n(),Q=h("p"),Q.innerHTML=pa,ot=n(),i(A.$$.fragment),pt=n(),E=h("p"),E.innerHTML=ca,ct=n(),i(D.$$.fragment),gt=n(),K=h("p"),K.innerHTML=ga,ht=n(),i(O.$$.fragment),mt=n(),ee=h("p"),ee.innerHTML=ha,ft=n(),i(te.$$.fragment),ut=n(),i(ae.$$.fragment),yt=n(),se=h("p"),se.innerHTML=ma,dt=n(),ne=h("p"),ne.innerHTML=fa,$t=n(),i(le.$$.fragment),bt=n(),ie=h("p"),ie.textContent=ua,wt=n(),i(re.$$.fragment),_t=n(),i(oe.$$.fragment),Mt=n(),pe=h("p"),pe.innerHTML=ya,vt=n(),i(ce.$$.fragment),Tt=n(),i(ge.$$.fragment),jt=n(),he=h("p"),he.textContent=da,Jt=n(),me=h("p"),me.innerHTML=$a,Ut=n(),i(M.$$.fragment),Gt=n(),i(fe.$$.fragment),kt=n(),ue=h("p"),ue.innerHTML=ba,Zt=n(),i(ye.$$.fragment),Ht=n(),i(de.$$.fragment),Ct=n(),$e=h("p"),$e.innerHTML=wa,xt=n(),i(be.$$.fragment),Xt=n(),we=h("p"),we.innerHTML=_a,Rt=n(),i(_e.$$.fragment),Yt=n(),Me=h("p"),Me.innerHTML=Ma,It=n(),i(ve.$$.fragment),Lt=n(),Te=h("p"),Te.innerHTML=va,qt=n(),i(je.$$.fragment),Ft=n(),i(Je.$$.fragment),Nt=n(),Ue=h("p"),Ue.innerHTML=Ta,Bt=n(),i(Ge.$$.fragment),Wt=n(),i(ke.$$.fragment),St=n(),Ze=h("p"),Ze.innerHTML=ja,zt=n(),i(He.$$.fragment),Vt=n(),Ce=h("p"),Ce.innerHTML=Ja,Pt=n(),i(xe.$$.fragment),Qt=n(),Re=h("p"),this.h()},l(e){const t=Ia("svelte-u9bgzb",document.head);u=m(t,"META",{name:!0,content:!0}),t.forEach(a),b=l(e),y=m(e,"P",{}),ka(y).forEach(a),w=l(e),r(v.$$.fragment,e),Ye=l(e),T=m(e,"P",{"data-svelte-h":!0}),f(T)!=="svelte-15r6soe"&&(T.innerHTML=Et),Ie=l(e),j=m(e,"UL",{"data-svelte-h":!0}),f(j)!=="svelte-zmlzlm"&&(j.innerHTML=Dt),Le=l(e),r(_.$$.fragment,e),qe=l(e),J=m(e,"P",{"data-svelte-h":!0}),f(J)!=="svelte-1u5cce3"&&(J.innerHTML=Kt),Fe=l(e),r(U.$$.fragment,e),Ne=l(e),G=m(e,"P",{"data-svelte-h":!0}),f(G)!=="svelte-1yl5xsc"&&(G.textContent=Ot),Be=l(e),r(k.$$.fragment,e),We=l(e),Z=m(e,"P",{"data-svelte-h":!0}),f(Z)!=="svelte-lwdt4f"&&(Z.innerHTML=ea),Se=l(e),r(H.$$.fragment,e),ze=l(e),C=m(e,"P",{"data-svelte-h":!0}),f(C)!=="svelte-thoypj"&&(C.innerHTML=ta),Ve=l(e),r(x.$$.fragment,e),Pe=l(e),X=m(e,"P",{"data-svelte-h":!0}),f(X)!=="svelte-1lhlim8"&&(X.innerHTML=aa),Qe=l(e),r(R.$$.fragment,e),Ae=l(e),Y=m(e,"P",{"data-svelte-h":!0}),f(Y)!=="svelte-i69e3z"&&(Y.innerHTML=sa),Ee=l(e),r(I.$$.fragment,e),De=l(e),L=m(e,"P",{"data-svelte-h":!0}),f(L)!=="svelte-wzuy4v"&&(L.innerHTML=na),Ke=l(e),q=m(e,"P",{"data-svelte-h":!0}),f(q)!=="svelte-130g6n6"&&(q.innerHTML=la),Oe=l(e),r(F.$$.fragment,e),et=l(e),r(N.$$.fragment,e),tt=l(e),B=m(e,"P",{"data-svelte-h":!0}),f(B)!=="svelte-1mzmozw"&&(B.innerHTML=ia),at=l(e),r(W.$$.fragment,e),st=l(e),r(S.$$.fragment,e),nt=l(e),z=m(e,"P",{"data-svelte-h":!0}),f(z)!=="svelte-1sdwkqa"&&(z.textContent=ra),lt=l(e),V=m(e,"P",{"data-svelte-h":!0}),f(V)!=="svelte-1sqatlx"&&(V.innerHTML=oa),it=l(e),r(P.$$.fragment,e),rt=l(e),Q=m(e,"P",{"data-svelte-h":!0}),f(Q)!=="svelte-1rc0mjs"&&(Q.innerHTML=pa),ot=l(e),r(A.$$.fragment,e),pt=l(e),E=m(e,"P",{"data-svelte-h":!0}),f(E)!=="svelte-gzsa62"&&(E.innerHTML=ca),ct=l(e),r(D.$$.fragment,e),gt=l(e),K=m(e,"P",{"data-svelte-h":!0}),f(K)!=="svelte-1f5b75n"&&(K.innerHTML=ga),ht=l(e),r(O.$$.fragment,e),mt=l(e),ee=m(e,"P",{"data-svelte-h":!0}),f(ee)!=="svelte-1jcko64"&&(ee.innerHTML=ha),ft=l(e),r(te.$$.fragment,e),ut=l(e),r(ae.$$.fragment,e),yt=l(e),se=m(e,"P",{"data-svelte-h":!0}),f(se)!=="svelte-1nx84sp"&&(se.innerHTML=ma),dt=l(e),ne=m(e,"P",{"data-svelte-h":!0}),f(ne)!=="svelte-16vpsz9"&&(ne.innerHTML=fa),$t=l(e),r(le.$$.fragment,e),bt=l(e),ie=m(e,"P",{"data-svelte-h":!0}),f(ie)!=="svelte-17yd1o0"&&(ie.textContent=ua),wt=l(e),r(re.$$.fragment,e),_t=l(e),r(oe.$$.fragment,e),Mt=l(e),pe=m(e,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-1cnzwe6"&&(pe.innerHTML=ya),vt=l(e),r(ce.$$.fragment,e),Tt=l(e),r(ge.$$.fragment,e),jt=l(e),he=m(e,"P",{"data-svelte-h":!0}),f(he)!=="svelte-y0ecwu"&&(he.textContent=da),Jt=l(e),me=m(e,"P",{"data-svelte-h":!0}),f(me)!=="svelte-ghromy"&&(me.innerHTML=$a),Ut=l(e),r(M.$$.fragment,e),Gt=l(e),r(fe.$$.fragment,e),kt=l(e),ue=m(e,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-1mswhvc"&&(ue.innerHTML=ba),Zt=l(e),r(ye.$$.fragment,e),Ht=l(e),r(de.$$.fragment,e),Ct=l(e),$e=m(e,"P",{"data-svelte-h":!0}),f($e)!=="svelte-1efx20p"&&($e.innerHTML=wa),xt=l(e),r(be.$$.fragment,e),Xt=l(e),we=m(e,"P",{"data-svelte-h":!0}),f(we)!=="svelte-1kdxyrq"&&(we.innerHTML=_a),Rt=l(e),r(_e.$$.fragment,e),Yt=l(e),Me=m(e,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-alo6um"&&(Me.innerHTML=Ma),It=l(e),r(ve.$$.fragment,e),Lt=l(e),Te=m(e,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-2rn2fx"&&(Te.innerHTML=va),qt=l(e),r(je.$$.fragment,e),Ft=l(e),r(Je.$$.fragment,e),Nt=l(e),Ue=m(e,"P",{"data-svelte-h":!0}),f(Ue)!=="svelte-1hmns4m"&&(Ue.innerHTML=Ta),Bt=l(e),r(Ge.$$.fragment,e),Wt=l(e),r(ke.$$.fragment,e),St=l(e),Ze=m(e,"P",{"data-svelte-h":!0}),f(Ze)!=="svelte-uwa6sa"&&(Ze.innerHTML=ja),zt=l(e),r(He.$$.fragment,e),Vt=l(e),Ce=m(e,"P",{"data-svelte-h":!0}),f(Ce)!=="svelte-199y79p"&&(Ce.innerHTML=Ja),Pt=l(e),r(xe.$$.fragment,e),Qt=l(e),Re=m(e,"P",{}),ka(Re).forEach(a),this.h()},h(){Za(u,"name","hf:doc:metadata"),Za(u,"content",Ba)},m(e,t){La(document.head,u),s(e,b,t),s(e,y,t),s(e,w,t),o(v,e,t),s(e,Ye,t),s(e,T,t),s(e,Ie,t),s(e,j,t),s(e,Le,t),o(_,e,t),s(e,qe,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,ze,t),s(e,C,t),s(e,Ve,t),o(x,e,t),s(e,Pe,t),s(e,X,t),s(e,Qe,t),o(R,e,t),s(e,Ae,t),s(e,Y,t),s(e,Ee,t),o(I,e,t),s(e,De,t),s(e,L,t),s(e,Ke,t),s(e,q,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,nt,t),s(e,z,t),s(e,lt,t),s(e,V,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,mt,t),s(e,ee,t),s(e,ft,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,ne,t),s(e,$t,t),o(le,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,me,t),s(e,Ut,t),o(M,e,t),s(e,Gt,t),o(fe,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,Rt,t),o(_e,e,t),s(e,Yt,t),s(e,Me,t),s(e,It,t),o(ve,e,t),s(e,Lt,t),s(e,Te,t),s(e,qt,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,zt,t),o(He,e,t),s(e,Vt,t),s(e,Ce,t),s(e,Pt,t),o(xe,e,t),s(e,Qt,t),s(e,Re,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(R.$$.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(le.$$.fragment,e),p(re.$$.fragment,e),p(oe.$$.fragment,e),p(ce.$$.fragment,e),p(ge.$$.fragment,e),p(M.$$.fragment,e),p(fe.$$.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(R.$$.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(le.$$.fragment,e),c(re.$$.fragment,e),c(oe.$$.fragment,e),c(ce.$$.fragment,e),c(ge.$$.fragment,e),c(M.$$.fragment,e),c(fe.$$.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(Ye),a(T),a(Ie),a(j),a(Le),a(qe),a(J),a(Fe),a(Ne),a(G),a(Be),a(We),a(Z),a(Se),a(ze),a(C),a(Ve),a(Pe),a(X),a(Qe),a(Ae),a(Y),a(Ee),a(De),a(L),a(Ke),a(q),a(Oe),a(et),a(tt),a(B),a(at),a(st),a(nt),a(z),a(lt),a(V),a(it),a(rt),a(Q),a(ot),a(pt),a(E),a(ct),a(gt),a(K),a(ht),a(mt),a(ee),a(ft),a(ut),a(yt),a(se),a(dt),a(ne),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(me),a(Ut),a(Gt),a(kt),a(ue),a(Zt),a(Ht),a(Ct),a($e),a(xt),a(Xt),a(we),a(Rt),a(Yt),a(Me),a(It),a(Lt),a(Te),a(qt),a(Ft),a(Nt),a(Ue),a(Bt),a(Wt),a(St),a(Ze),a(zt),a(Vt),a(Ce),a(Pt),a(Qt),a(Re)),a(u),g(v,e),g(_,e),g(U,e),g(k,e),g(H,e),g(x,e),g(R,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(le,e),g(re,e),g(oe,e),g(ce,e),g(ge,e),g(M,e),g(fe,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 Ra{constructor(u){super(),Ya(this,u,Wa,Na,xa,{})}}export{Aa as component};
