Documentation Index
Fetch the complete documentation index at: https://docs.pixeltable.com/llms.txt
Use this file to discover all available pages before exploring further.
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
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: Useschema_overrides to customize type mapping when needed.
Explanation
Why import Hugging Face datasets into Pixeltable:- Add computed columns - Enrich data with embeddings, AI analysis, or transformations
- Incremental processing - Add new rows without reprocessing existing data
- Persistent storage - Keep processed results across sessions
- Query capabilities - Filter, aggregate, and join with other tables
datasets library before importing.
See also
- Import CSV files - For CSV and Excel imports
- Semantic text search - Add embeddings to text data
- Hugging Face integration notebook - Full integration guide