---
title: "Import data from Hugging Face datasets"
description: "Load datasets from Hugging Face Hub into Pixeltable tables for processing with AI models."
url: "https://www.pixeltable.com/notebooks/data-import-huggingface"
updated: "2026-10-06"
---

# Import data from Hugging Face datasets

Load datasets from Hugging Face Hub into Pixeltable tables for processing with AI models.

- **Type:** Notebook
- **Group:** Data Import/Export

## How it works

You use pxt.create_table() with a Hugging Face dataset as the source parameter. Pixeltable automatically maps HF types to Pixeltable column types.

## What it covers

- Import Hugging Face datasets directly into tables
- Handle datasets with multiple splits (train/test/validation)
- Work with image datasets

## What it uses

- **Install:** `pip install pixeltable datasets`
- **Pixeltable calls:** `pxt.create_table()`, `add_computed_column()`

## A look at the code

```python
# Import each split separately for clarity
train_data = pxt.create_table(
    'hf_demo/reviews_train', source=hf_dataset_dict['train']
)
test_data = pxt.create_table(
    'hf_demo/reviews_test', source=hf_dataset_dict['test']
)
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/data/data-import-huggingface.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/data/data-import-huggingface
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/data/data-import-huggingface.ipynb
