Hub Python Library documentation
Mengelola koleksi
Mulai
Panduan cara melakukan
RingkasanUnduh fileUnggah fileBucketsGunakan CLIBuat ekstensi CLIHfFileSystemRepositoryCariInferensiEndpoint InferensiTugasSandboxTab KomunitasKoleksiCacheKartu ModelKelola Space AndaIntegrasi pustakaWebhooks
Panduan konseptual
Paradigma Git vs HTTPSandbox di balik layarMigrasi ke huggingface_hub v2.0Migrasi ke huggingface_hub v1.0
Referensi
IkhtisarAutentikasiVariabel lingkunganHugging Face Hub APICLIMengunduh fileMixin & metode serialisasiJenis InferensiKlien InferensiEndpoint InferensiKlien MCPHfFileSystemURI HFUtilitasDiskusi dan Pull RequestReferensi sistem cacheRepo Cards dan Data Repo CardRuntime SpaceKoleksiLogger TensorBoardServer WebhooksSerialisasiDataclass ketatOAuthTugasSandbox
You are viewing main version, which requires installation from source. If you'd like
regular pip install, checkout the latest stable version (v2.4.0).
Mengelola koleksi
Lihat halaman dokumentasi HfApi untuk referensi metode untuk mengelola Space Anda di Hub.
- Dapatkan konten koleksi: get_collection()
- Buat koleksi baru: create_collection()
- Perbarui koleksi: update_collection_metadata()
- Perbarui grup sumber daya koleksi: update_collection_resource_group()
- Hapus koleksi: delete_collection()
- Tambahkan item ke koleksi: add_collection_item()
- Perbarui item dalam koleksi: update_collection_item()
- Hapus item dari koleksi: delete_collection_item()
Koleksi
kelas huggingface_hub.Collection
< source >( **kwargs )
Parameter
- slug (
str) — Slug dari koleksi. Contoh:"TheBloke/recent-models-64f9a55bb3115b4f513ec026". - title (
str) — Judul koleksi. Contoh:"Recent models". - owner (
str) — Pemilik koleksi. Contoh:"TheBloke". - items (
list[CollectionItem]) — Daftar item dalam koleksi. - last_updated (
datetime) — Tanggal pembaruan terakhir dari koleksi. - position (
int) — Posisi koleksi dalam daftar koleksi pemilik. - private (
bool) — Apakah koleksi bersifat privat atau tidak. - theme (
str) — Tema dari koleksi. Contoh:"green". - upvotes (
int) — Jumlah upvotes dari koleksi. - description (
str, opsional) — Deskripsi koleksi, sebagai teks biasa. - url (
str) — (properti) URL dari koleksi di Hub.
Berisi informasi tentang Koleksi di Hub.
CollectionItem
kelas huggingface_hub.CollectionItem
< source >( _id: strid: strtype: CollectionItemType_Tposition: intnote: dict | None = None**kwargs )
Parameter
- item_object_id (
str) — ID unik dari item dalam koleksi. - item_id (
str) — ID dari objek mendasar di Hub. Bisa berupa repo_id, id paper, slug koleksi, atau id bucket. mis."jbilcke-hf/ai-comic-factory","2307.09288","celinah/cerebras-function-calling-682607169c35fbfa98b30b9a". - item_type (
str) — Jenis objek dasarnya. Bisa berupa salah satu dari"model","dataset","space","paper","collection"atau"bucket". - position (
int) — Posisi item dalam koleksi. - note (
str, opsional) — Catatan yang terkait dengan item, sebagai teks biasa.
Berisi informasi tentang sebuah item dari Collection (model, dataset, Space, paper, collection, atau bucket).