Command-Line Interface#

After you installed energon, a script called energon will be added to your PATH. It provides commands to prepare, preview, or inspect datasets on disk.

Here’s a simple example:

energon prepare /mnt/data/my_captioning_webdataset

The above command will scan your existing off-the-shelf web dataset and add the needed metadata to make it compatible with Energon. The same command can also prepare JSONL files and Parquet shard directories.

Below, you can see the available sub-commands under energon.

energon#

A set of tools that energon provides.

Among other things, you can use it to prepare, preview, or inspect your dataset.

See help of commands to learn more.

Usage

energon [OPTIONS] [COMMAND] [ARGS]...

Options

-V, --version#

Show version and exit.

Commands

analyze-debug

Internal tool to analyze randomness.

checkpoint

Tools for energon checkpoints.

info

Get summarizing information about a dataset.

mount

Mount an energon WebdatasetFileStore at…

prepare

Prepare WebDataset for use with energon.

prepare-media

Prepare a filesystem dataset by collecting…

preview

Preview samples of a dataset on the console.

energon prepare#

An interactive tool to generate metadata for your existing webdataset, JSONL dataset, or Parquet dataset. This will help make the dataset compliant with our format.

For WebDataset and manifest-backed shard directories, the tool will ask you for a train/val/test split and how to assign fields to the corresponding sample type in Energon. For single-file JSONL and Parquet datasets, preparation only validates or creates the lightweight sidecar index needed for direct loading.

See Data Preparation for more details on how to use this command.

energon info#

Prints information about the dataset such as overall number of samples and size. It also prints the energon version that was used to prepare the dataset, if a recent version was used.

energon mount#

Use this to mount your prepared dataset as a virtual read-only filesystem and inspect it using ls or other file browsing tools. It is as simple as running

energon mount /PATH/TO/DATASET ./MY_MOUNT_POINT

This will leave the process in the foreground and the mount will exist as long as the program is running. If you want to detach the process to the background, use the -d or --detach flag.

Two modes are supported by energon mount:

Flat mode (default)

Sample folder mode (flag -s)

Description

All files from all shards listed at
the root of the mount point.

One folder per sample key,
each folder containing files
named by the sample part extension

Example

001.jpg
001.txt
002.jpg
002.txt
...

001/
┣ jpg
┗ txt
002/
┣ jpg
┗ txt
...

Warning

You should not use the same sample keys in multiple shards of the same dataset. If you do, energon mount will not work as intended and it will display WARNING files in the virtual mount.

energon preview#

This command will load a dataset and display samples one-by-one on the console. Note that this will not work for datasets with non-standard flavors or crude datasets.