Installation
pip install metaflow-card-hf-dataset
Usage
After installing the module, you can add any HuggingFace dataset to your Metaflow tasks by using the @huggingface_dataset decorator. There are two ways to use the decorator:
- Via the
idargument, which is the dataset ID from HuggingFace. - Via the
artifact_idargument, which is the name of a FlowSpec artifact that contains the dataset ID.
Use the first if your workflow always reads from the same HuggingFace dataset ID. Use the second if your workflow pass in dataset IDs as parameters or changes them dynamically.
from metaflow import FlowSpec, step, huggingface_dataset, Parameter
class Flow(FlowSpec):
eval_ds = Parameter('eval_ds', default='argilla/databricks-dolly-15k-curated-en', help='HuggingFace dataset id.')
# Dynamically input: python flow.py run --eval_ds lighteval/mmlu
@huggingface_dataset(id="princeton-nlp/SWE-bench")
@step
def start(self):
self.another_one = 'wikimedia/wikipedia'
self.next(self.end)
@huggingface_dataset(artifact_id="another_one") # Use the dataset ID set to an artifact var.
@huggingface_dataset(artifact_id="eval_ds") # Use the dataset ID passed as a parameter.
@step
def end(self):
pass
if __name__ == '__main__':
Flow()
Metadata
Release files for metaflow-card-hf-dataset 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metaflow_card_hf_dataset-0.0.6.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 17.5 kB
Release files / metaflow_card_hf_dataset-0.0.6.tar.gz
| Download URL | metaflow_card_hf_dataset-0.0.6.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf09383f06c1bceaf0d3b94cac873ccefbf606a317818ee5125f23abbc93291f
|
|
BLAKE2b-256 checksum How to use checksums |
ce566c109556243aa9beddf5231a615a56425e28eee7b100e8b074b9acc2e8c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.5
|
Release files / metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl
| Download URL | metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5ae424432b2d7c30d097d2c18e1694923cd0acd602fb0e1fce70968c69ca3100
|
|
BLAKE2b-256 checksum How to use checksums |
527b623716a18a56d59faae7b43c58e43d3f868add4c7cb775a29ca6da78b849
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.5
|