import{s as ne,n as ie,o as ce}from"../chunks/scheduler.0cf4ef2e.js";import{S as ae,i as le,e as g,s as i,c as C,h as re,a as s,d as o,b as c,f as V,g as v,j as W,k as F,l as E,m as n,n as x,t as q,o as y,p as w}from"../chunks/index.abc433bf.js";import{C as ge}from"../chunks/CopyLLMTxtMenu.efc6b005.js";import{D as oe}from"../chunks/Docstring.e4170f41.js";import{H as Q,E as se}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.86d448e2.js";function ue(X){let a,L,I,A,u,D,h,P,m,Y='Check out the <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi">HfApi</a> documentation page for the reference of methods to manage your Space on the Hub.',M,f,Z='<li>Get collection content: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.get_collection">get_collection()</a></li> <li>Create new collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_collection">create_collection()</a></li> <li>Update a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_collection_metadata">update_collection_metadata()</a></li> <li>Delete a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_collection">delete_collection()</a></li> <li>Add an item to a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.add_collection_item">add_collection_item()</a></li> <li>Update an item in a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_collection_item">update_collection_item()</a></li> <li>Remove an item from a collection: <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_collection_item">delete_collection_item()</a></li>',j,d,S,l,p,J,H,ee="Contains information about a Collection on the Hub.",U,_,R,r,b,K,k,te="Contains information about an item of a Collection (model, dataset, Space, paper or collection).",N,$,O,T,z;return u=new ge({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new Q({props:{title:"Managing collections",local:"managing-collections",headingTag:"h1"}}),d=new Q({props:{title:"Collection",local:"huggingface_hub.Collection",headingTag:"h3"}}),p=new oe({props:{name:"class huggingface_hub.Collection",anchor:"huggingface_hub.Collection",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.Collection.slug",description:`<strong>slug</strong> (<code>str</code>) &#x2014;
Slug of the collection. E.g. <code>&quot;TheBloke/recent-models-64f9a55bb3115b4f513ec026&quot;</code>.`,name:"slug"},{anchor:"huggingface_hub.Collection.title",description:`<strong>title</strong> (<code>str</code>) &#x2014;
Title of the collection. E.g. <code>&quot;Recent models&quot;</code>.`,name:"title"},{anchor:"huggingface_hub.Collection.owner",description:`<strong>owner</strong> (<code>str</code>) &#x2014;
Owner of the collection. E.g. <code>&quot;TheBloke&quot;</code>.`,name:"owner"},{anchor:"huggingface_hub.Collection.items",description:`<strong>items</strong> (<code>list[CollectionItem]</code>) &#x2014;
List of items in the collection.`,name:"items"},{anchor:"huggingface_hub.Collection.last_updated",description:`<strong>last_updated</strong> (<code>datetime</code>) &#x2014;
Date of the last update of the collection.`,name:"last_updated"},{anchor:"huggingface_hub.Collection.position",description:`<strong>position</strong> (<code>int</code>) &#x2014;
Position of the collection in the list of collections of the owner.`,name:"position"},{anchor:"huggingface_hub.Collection.private",description:`<strong>private</strong> (<code>bool</code>) &#x2014;
Whether the collection is private or not.`,name:"private"},{anchor:"huggingface_hub.Collection.theme",description:`<strong>theme</strong> (<code>str</code>) &#x2014;
Theme of the collection. E.g. <code>&quot;green&quot;</code>.`,name:"theme"},{anchor:"huggingface_hub.Collection.upvotes",description:`<strong>upvotes</strong> (<code>int</code>) &#x2014;
Number of upvotes of the collection.`,name:"upvotes"},{anchor:"huggingface_hub.Collection.description",description:`<strong>description</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Description of the collection, as plain text.`,name:"description"},{anchor:"huggingface_hub.Collection.url",description:`<strong>url</strong> (<code>str</code>) &#x2014;
(property) URL of the collection on the Hub.`,name:"url"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_api.py#L1183"}}),_=new Q({props:{title:"CollectionItem",local:"huggingface_hub.CollectionItem",headingTag:"h3"}}),b=new oe({props:{name:"class huggingface_hub.CollectionItem",anchor:"huggingface_hub.CollectionItem",parameters:[{name:"_id",val:": str"},{name:"id",val:": str"},{name:"type",val:": CollectionItemType_T"},{name:"position",val:": int"},{name:"note",val:": Optional[dict] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.CollectionItem.item_object_id",description:`<strong>item_object_id</strong> (<code>str</code>) &#x2014;
Unique ID of the item in the collection.`,name:"item_object_id"},{anchor:"huggingface_hub.CollectionItem.item_id",description:`<strong>item_id</strong> (<code>str</code>) &#x2014;
ID of the underlying object on the Hub. Can be either a repo_id, a paper id or a collection slug.
e.g. <code>&quot;jbilcke-hf/ai-comic-factory&quot;</code>, <code>&quot;2307.09288&quot;</code>, <code>&quot;celinah/cerebras-function-calling-682607169c35fbfa98b30b9a&quot;</code>.`,name:"item_id"},{anchor:"huggingface_hub.CollectionItem.item_type",description:`<strong>item_type</strong> (<code>str</code>) &#x2014;
Type of the underlying object. Can be one of <code>&quot;model&quot;</code>, <code>&quot;dataset&quot;</code>, <code>&quot;space&quot;</code>, <code>&quot;paper&quot;</code> or <code>&quot;collection&quot;</code>.`,name:"item_type"},{anchor:"huggingface_hub.CollectionItem.position",description:`<strong>position</strong> (<code>int</code>) &#x2014;
Position of the item in the collection.`,name:"position"},{anchor:"huggingface_hub.CollectionItem.note",description:`<strong>note</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Note associated with the item, as plain text.`,name:"note"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/hf_api.py#L1138"}}),$=new se({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/collections.md"}}),{c(){a=g("meta"),L=i(),I=g("p"),A=i(),C(u.$$.fragment),D=i(),C(h.$$.fragment),P=i(),m=g("p"),m.innerHTML=Y,M=i(),f=g("ul"),f.innerHTML=Z,j=i(),C(d.$$.fragment),S=i(),l=g("div"),C(p.$$.fragment),J=i(),H=g("p"),H.textContent=ee,U=i(),C(_.$$.fragment),R=i(),r=g("div"),C(b.$$.fragment),K=i(),k=g("p"),k.textContent=te,N=i(),C($.$$.fragment),O=i(),T=g("p"),this.h()},l(e){const t=re("svelte-u9bgzb",document.head);a=s(t,"META",{name:!0,content:!0}),t.forEach(o),L=c(e),I=s(e,"P",{}),V(I).forEach(o),A=c(e),v(u.$$.fragment,e),D=c(e),v(h.$$.fragment,e),P=c(e),m=s(e,"P",{"data-svelte-h":!0}),W(m)!=="svelte-w6r9q"&&(m.innerHTML=Y),M=c(e),f=s(e,"UL",{"data-svelte-h":!0}),W(f)!=="svelte-1v5in1k"&&(f.innerHTML=Z),j=c(e),v(d.$$.fragment,e),S=c(e),l=s(e,"DIV",{class:!0});var B=V(l);v(p.$$.fragment,B),J=c(B),H=s(B,"P",{"data-svelte-h":!0}),W(H)!=="svelte-182nhcq"&&(H.textContent=ee),B.forEach(o),U=c(e),v(_.$$.fragment,e),R=c(e),r=s(e,"DIV",{class:!0});var G=V(r);v(b.$$.fragment,G),K=c(G),k=s(G,"P",{"data-svelte-h":!0}),W(k)!=="svelte-v7741j"&&(k.textContent=te),G.forEach(o),N=c(e),v($.$$.fragment,e),O=c(e),T=s(e,"P",{}),V(T).forEach(o),this.h()},h(){F(a,"name","hf:doc:metadata"),F(a,"content",he),F(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(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(e,t){E(document.head,a),n(e,L,t),n(e,I,t),n(e,A,t),x(u,e,t),n(e,D,t),x(h,e,t),n(e,P,t),n(e,m,t),n(e,M,t),n(e,f,t),n(e,j,t),x(d,e,t),n(e,S,t),n(e,l,t),x(p,l,null),E(l,J),E(l,H),n(e,U,t),x(_,e,t),n(e,R,t),n(e,r,t),x(b,r,null),E(r,K),E(r,k),n(e,N,t),x($,e,t),n(e,O,t),n(e,T,t),z=!0},p:ie,i(e){z||(q(u.$$.fragment,e),q(h.$$.fragment,e),q(d.$$.fragment,e),q(p.$$.fragment,e),q(_.$$.fragment,e),q(b.$$.fragment,e),q($.$$.fragment,e),z=!0)},o(e){y(u.$$.fragment,e),y(h.$$.fragment,e),y(d.$$.fragment,e),y(p.$$.fragment,e),y(_.$$.fragment,e),y(b.$$.fragment,e),y($.$$.fragment,e),z=!1},d(e){e&&(o(L),o(I),o(A),o(D),o(P),o(m),o(M),o(f),o(j),o(S),o(l),o(U),o(R),o(r),o(N),o(O),o(T)),o(a),w(u,e),w(h,e),w(d,e),w(p),w(_,e),w(b),w($,e)}}}const he='{"title":"Managing collections","local":"managing-collections","sections":[{"title":"Collection","local":"huggingface_hub.Collection","sections":[],"depth":3},{"title":"CollectionItem","local":"huggingface_hub.CollectionItem","sections":[],"depth":3}],"depth":1}';function me(X){return ce(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $e extends ae{constructor(a){super(),le(this,a,me,ue,ne,{})}}export{$e as component};
