Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a dataset card and the pipeline.yaml on Distiset.push_to_hub #479

Merged
merged 11 commits into from
Mar 26, 2024

Conversation

plaguss
Copy link
Contributor

@plaguss plaguss commented Mar 25, 2024

Description

This PR adds the functionality to create a minimal dataset card and push the pipeline.yaml to the hub.

For an example:

This pipeline:

from distilabel.pipeline.local import Pipeline
from distilabel.steps.generators.data import LoadDataFromDicts


if __name__ == "__main__":
    with Pipeline(name="test-push-distiset") as pipeline:
        load_data = LoadDataFromDicts(
            name="load_data",
            data=[
                {
                    "instruction": "What if the Beatles had never formed as a band?",
                    "completion": "The Beatles are widely credited with starting the British Invasion, a wave of rock and roll bands from the United Kingdom that became popular in America in the 1960s. If the Beatles had never formed, this musical movement may have never happened, and the world may have been exposed to a different kind of music. So, without the Beatles\u2019 fame and success, other bands wouldn\u2019t have been able to break into the American music scene and create a wider range of sounds. We could have ended up with a less interesting mix of songs playing on the radio."
                },
                {
                    "instruction": "Given that f(x) = 5x^3 - 2x + 3, find the value of f(2).",
                    "completion": "The problem is asking us to find the value of the function f(x) = 5x^3 - 2x + 3 at the point x = 2. \n\nStep 1: Substitute x with 2 in the function\nWe replace every x in the function with 2. This gives us:\nf(2) = 5(2)^3 - 2(2) + 3\n\nStep 2: Simplify the expression\nNext, we simplify the expression by performing the operations in order from left to right.\n\nFirst, calculate the cube of 2, which is 8. Substitute this back into the expression:\nf(2) = 5(8) - 4 + 3\n\nThen, multiply 5 by 8 which gives us 40:\nf(2) = 40 - 4 + 3\n\nFinally, subtract 4 from 40 which gives us 36, and then add 3 to that:\nf(2) = 36 + 3\n\nStep 3: Final calculation\nNow, add 36 and 3 together:\nf(2) = 39\n\nSo, the value of the function f(x) = 5x^3 - 2x + 3 at the point x = 2 is 39."
                }
            ]
        )

        ds = pipeline.run()
        ds.push_to_hub("distilabel-internal-testing/test-distiset-extra-info", generate_card=True)

Generates the following dataset.

This PR adds a dataset card with information of the dataset and pushes the pipeline.yaml to help reproducing the pipeline.

Closes #478.

@plaguss plaguss added this to the 1.0.0 milestone Mar 25, 2024
@plaguss plaguss added the enhancement New feature or request label Mar 25, 2024
@plaguss plaguss self-assigned this Mar 25, 2024
@plaguss plaguss linked an issue Mar 26, 2024 that may be closed by this pull request
@plaguss plaguss marked this pull request as ready for review March 26, 2024 08:33
Copy link
Member

@gabrielmbmb gabrielmbmb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! just a small details before merging

src/distilabel/utils/distiset.py Outdated Show resolved Hide resolved
@gabrielmbmb gabrielmbmb merged commit a8ee77a into core-refactor Mar 26, 2024
4 checks passed
@gabrielmbmb gabrielmbmb deleted the push-to-hub-extra branch March 26, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add README.md and pipeline.yaml on Distiset.push_to_hub
2 participants