MLCommons datasets format.
Actively maintained. Last release 8 weeks ago, commits in 9 of the last 26 weeks. A safe choice.
pip install mlcroissantmlcroissant 🥐
Discover mlcroissant 🥐 with this
introduction tutorial in Google Colab.
Python requirements
Python version >= 3.10.
If you do not have a Python environment:
python3 -m venv ~/py3
source ~/py3/bin/activate
Install
python -m pip install ".[dev]"
The command can fail, for example, due to missing dependencies, e.g.:
Failed to build pygraphviz
ERROR: Could not build wheels for pygraphviz, which is required to install pyproject.toml-based projects
This can be fixed by running
sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config
Conda installation
Conda can help create a consistent environment. It can also be useful to install packages without root access. To use Conda, run:
conda create --name croissant python=3.10 -y
conda activate croissant
conda install graphviz
python3 -m pip install ".[dev]"
Verify/load a Croissant dataset
mlcroissant validate --jsonld ../../datasets/titanic/metadata.json
The command:
- Exits with 0, prints
Doneand displays encountered warnings, when no error was found in the file. - Exits with 1 and displays all encountered errors/warnings, otherwise.
Similarly, you can generate a dataset by launching:
mlcroissant load \
--jsonld ../../datasets/titanic/metadata.json \
--record_set passengers \
--num_records 10
Loading a distribution via git+https
If the encodingFormat of a distribution is git+https, please provide the username and password by setting the CROISSANT_GIT_USERNAME and CROISSANT_GIT_PASSWORD environment variables. These will be used to construct the authentication necessary to load the distribution.
Note that, for datasets hosted on HuggingFace, CROISSANT_GIT_USERNAME and CROISSANT_GIT_PASSWORD should correspond respectively to your HuggingFace's username and User Access Token. User Access Tokens can be generated following .