Hub Python 庫文件
管理集合
加入 Hugging Face 社群
並獲得增強的文件體驗
開始使用
管理集合
請檢視 HfApi 文件頁面,瞭解管理 Hub 上您空間的引用方法。
- 獲取集合內容:get_collection()
- 建立新集合:create_collection()
- 更新集合:update_collection_metadata()
- 刪除集合:delete_collection()
- 向集合新增專案:add_collection_item()
- 更新集合中的專案:update_collection_item()
- 從集合中刪除專案:delete_collection_item()
集合
類 huggingface_hub.Collection
< 來源 >( **kwargs )
引數
- slug (
str
) — 集合的 slug。例如"TheBloke/recent-models-64f9a55bb3115b4f513ec026"
。 - title (
str
) — 集合的標題。例如"Recent models"
。 - owner (
str
) — 集合的所有者。例如"TheBloke"
。 - items (
List[CollectionItem]
) — 集合中的專案列表。 - last_updated (
datetime
) — 集合的最後更新日期。 - position (
int
) — 集合在所有者集合列表中的位置。 - private (
bool
) — 集合是否為私有。 - theme (
str
) — 集合的主題。例如"green"
。 - upvotes (
int
) — 集合的點贊數。 - description (
str
, 可選) — 集合的描述,純文字格式。 - url (
str
) — (屬性)Hub 上集合的 URL。
包含 Hub 上集合的資訊。
CollectionItem
類 huggingface_hub.CollectionItem
< 來源 >( _id: str id: str type: CollectionItemType_T position: int note: Optional[Dict] = None **kwargs )
引數
- item_object_id (
str
) — 集合中專案的唯一 ID。 - item_id (
str
) — Hub 上底層物件的 ID。可以是 repo_id、論文 ID 或集合 slug。例如"jbilcke-hf/ai-comic-factory"
、"2307.09288"
、"celinah/cerebras-function-calling-682607169c35fbfa98b30b9a"
。 - item_type (
str
) — 底層物件的型別。可以是"model"
、"dataset"
、"space"
、"paper"
或"collection"
。 - position (
int
) — 專案在集合中的位置。 - note (
str
, 可選) — 與專案關聯的備註,純文字格式。
包含集合(模型、資料集、空間、論文或集合)中專案的資訊。