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
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()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaflow_card_hf_dataset-0.0.6.tar.gz.
File metadata
- Download URL: metaflow_card_hf_dataset-0.0.6.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf09383f06c1bceaf0d3b94cac873ccefbf606a317818ee5125f23abbc93291f
|
|
| MD5 |
c8c779b2a999d31846a8988cbcbb7563
|
|
| BLAKE2b-256 |
ce566c109556243aa9beddf5231a615a56425e28eee7b100e8b074b9acc2e8c9
|
File details
Details for the file metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl.
File metadata
- Download URL: metaflow_card_hf_dataset-0.0.6-py2.py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae424432b2d7c30d097d2c18e1694923cd0acd602fb0e1fce70968c69ca3100
|
|
| MD5 |
818a461d35355739572a96125e38b01a
|
|
| BLAKE2b-256 |
527b623716a18a56d59faae7b43c58e43d3f868add4c7cb775a29ca6da78b849
|