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, 可选) — 集合的描述(纯文本)。
  • url (str) — (属性) 集合在 Hub 上的 URL。

包含 Hub 上关于集合的信息。

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、论文 ID、集合 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, 可选) — 与项目关联的备注(纯文本)。

包含关于集合中项目(模型、数据集、Space、论文、集合或存储桶)的信息。

在 GitHub 上更新

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