Skip to main content
Open in Kaggle  Open in Colab  Download Notebook
This documentation page is also available as an interactive notebook. You can launch the notebook in Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the above links.
Load datasets from Hugging Face Hub into Pixeltable tables for processing with AI models.

Problem

You want to use a dataset from Hugging Face Hub—for fine-tuning, evaluation, or analysis. You need to load it into a format where you can add computed columns, embeddings, or AI transformations.

Solution

What’s in this recipe:
  • Import Hugging Face datasets directly into tables
  • Handle datasets with multiple splits (train/test/validation)
  • Work with image datasets
You use pxt.create_table() with a Hugging Face dataset as the source parameter. Pixeltable automatically maps HF types to Pixeltable column types.

Setup

Created directory ‘hf_demo’.
<pixeltable.catalog.dir.Dir at 0x31e39d8d0>

Import a single split

Load a specific split from a dataset:
Created table ‘reviews’.
Inserting rows into `reviews`: 100 rows [00:00, 14781.69 rows/s]
Inserted 100 rows with 0 errors.

Import multiple splits

Load a DatasetDict with multiple splits and track which split each row came from:
Created table ‘reviews_train’.
Inserting rows into `reviews_train`: 50 rows [00:00, 10150.29 rows/s]
Inserted 50 rows with 0 errors.
Created table ‘reviews_test’.
Inserting rows into `reviews_test`: 50 rows [00:00, 9883.37 rows/s]
Inserted 50 rows with 0 errors.

Add AI-powered computed columns

Enrich the dataset with AI models:
Added 100 column values with 0 errors.
100 rows updated, 200 values computed.

Type mapping

Pixeltable automatically maps Hugging Face types to Pixeltable types:
Use schema_overrides to customize type mapping when needed.

Explanation

Why import Hugging Face datasets into Pixeltable:
  1. Add computed columns - Enrich data with embeddings, AI analysis, or transformations
  2. Incremental processing - Add new rows without reprocessing existing data
  3. Persistent storage - Keep processed results across sessions
  4. Query capabilities - Filter, aggregate, and join with other tables
Working with large datasets: For very large datasets, consider loading in batches or using streaming mode in the datasets library before importing.

See also

Last modified on June 24, 2026