---
title: "Working with Hugging Face"
description: "Pixeltable provides seamless integration with Hugging Face datasets and models."
url: "https://www.pixeltable.com/notebooks/working-with-hugging-face"
updated: "2026-02-03"
---

# Working with Hugging Face

Pixeltable provides seamless integration with Hugging Face datasets and models.

- **Type:** Notebook
- **Group:** Providers

## What it covers

- Importing datasets directly into Pixeltable tables
- Working with dataset splits (train/test/validation)
- Streaming large datasets with IterableDataset
- Type mappings from Hugging Face to Pixeltable
- Using Hugging Face models for embeddings

## What it uses

- **Install:** `pip install pixeltable datasets torch transformers sentence-transformers`
- **Pixeltable calls:** `pxt.create_table()`, `group_by()`, `insert()`, `add_embedding_index()`, `similarity()`

## A look at the code

```python
from pixeltable.functions.huggingface import clip

# Add CLIP embedding index for cross-modal image search
images.add_embedding_index(
    'Image', embedding=clip.using(model_id='openai/clip-vit-base-patch32')
)

# Search images using text
sim = images.Image.similarity(string='anime character with red clothes')
images.order_by(sim, asc=False).limit(3).select(
    images.Image, images.Name, sim=sim
).collect()
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/providers/working-with-hugging-face.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/providers/working-with-hugging-face
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/providers/working-with-hugging-face.ipynb
