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

Add num_generations and group_generations parameters to Task #416

Merged
merged 13 commits into from
Mar 14, 2024

Conversation

gabrielmbmb
Copy link
Member

Description

This PR adds the num_generations runtime parameter which will be used to define the number of generations to create per input using an LLM. In addition, the group_generations parameter is added which defines whether a list with the num_generations is created or if a row with each generation is created:

# num_generations = 3, group_generations = True
[
    {"instruction": "Hello, how are you?", "generation": ["Hi, I'm fine", "Hi, I'm fine, thank you for asking", "Hi! I'm fine and you?"]}
]

# num_generations = 3, group_generations = False
[
    {"instruction": "Hello, how are you?", "generation": "Hi, I'm fine"},
    {"instruction": "Hello, how are you?", "generation": "Hi, I'm fine, thank you for asking"},
    {"instruction": "Hello, how are you?", "generation": "Hi! I'm fine and you?"},
]

In addition, this PR has updated all the LLMs implementations to handle the num_generations parameter.

Closes #413

@gabrielmbmb gabrielmbmb added the enhancement New feature or request label Mar 13, 2024
@gabrielmbmb gabrielmbmb added this to the 1.0.0 milestone Mar 13, 2024
@gabrielmbmb gabrielmbmb self-assigned this Mar 13, 2024
@gabrielmbmb gabrielmbmb linked an issue Mar 13, 2024 that may be closed by this pull request
Copy link
Member

@alvarobartt alvarobartt left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Just some comments to tackle before approving and merging!

src/distilabel/llm/mistral.py Outdated Show resolved Hide resolved
src/distilabel/llm/mistral.py Show resolved Hide resolved
tests/unit/steps/task/test_text_generation.py Outdated Show resolved Hide resolved
@gabrielmbmb gabrielmbmb merged commit 90691cf into core-refactor Mar 14, 2024
4 checks passed
@gabrielmbmb gabrielmbmb deleted the add_num_generations_parameter branch March 14, 2024 16:28
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.

Add num_generations parameter to LLMs
2 participants