Skip to main content

A metaflow card that renders HTML inputs.

Project description

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 id argument, which is the dataset ID from HuggingFace.
  • Via the artifact_id argument, 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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaflow_card_hf_dataset-0.0.6.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl (9.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file metaflow_card_hf_dataset-0.0.6.tar.gz.

File metadata

File hashes

Hashes for metaflow_card_hf_dataset-0.0.6.tar.gz
Algorithm Hash digest
SHA256 bf09383f06c1bceaf0d3b94cac873ccefbf606a317818ee5125f23abbc93291f
MD5 c8c779b2a999d31846a8988cbcbb7563
BLAKE2b-256 ce566c109556243aa9beddf5231a615a56425e28eee7b100e8b074b9acc2e8c9

See more details on using hashes here.

File details

Details for the file metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5ae424432b2d7c30d097d2c18e1694923cd0acd602fb0e1fce70968c69ca3100
MD5 818a461d35355739572a96125e38b01a
BLAKE2b-256 527b623716a18a56d59faae7b43c58e43d3f868add4c7cb775a29ca6da78b849

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page