Hub Python 函式庫文件

管理收藏

Hugging Face's logo
加入 Hugging Face 社群

並獲得增強的文件體驗

開始使用

管理收藏

請查看 HfApi 文件頁面,以取得管理您 Hub 上 Space 的方法參考。

Collection

class 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, optional) — 收藏說明(純文字)。
  • url (str) — (屬性) 收藏在 Hub 上的 URL。

包含 Hub 上 Collection 的相關資訊。

CollectionItem

class huggingface_hub.CollectionItem

< >

( _id: str id: str type: CollectionItemType_T position: int note: dict | None = None **kwargs )

參數

  • item_object_id (str) — 收藏中項目的唯一識別碼 (ID)。
  • item_id (str) — Hub 上底層物件的 ID。可以是 repo_id、paper id、collection slug 或 bucket id。例如:"jbilcke-hf/ai-comic-factory""2307.09288""celinah/cerebras-function-calling-682607169c35fbfa98b30b9a"
  • item_type (str) — 底層物件的類型。可以是 "model""dataset""space""paper""collection""bucket" 之一。
  • position (int) — 項目在收藏中的位置。
  • note (str, optional) — 與項目關聯的備註(純文字)。

包含關於 Collection(模型、資料集、Space、論文、收藏或儲存桶)項目的相關資訊。

在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.