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 Magpie and MagpieGenerator tasks #778

Merged
merged 32 commits into from
Jul 15, 2024
Merged

Add Magpie and MagpieGenerator tasks #778

merged 32 commits into from
Jul 15, 2024

Conversation

gabrielmbmb
Copy link
Member

@gabrielmbmb gabrielmbmb commented Jul 10, 2024

Description

This PR adds two new tasks Magpie and MagpieGenerator based on Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing paper, which presents a new way to leverage chat template and the autoregressive capabilities of the instruct fine-tuned LLMs to generate instructions without seed data or a specific system prompt.

In addition, a new mixin MagpieChatTemplateMixin has been added that has to be used in combination with the aforementioned tasks. This mixin requires LLMs that are able to send the raw input (with special tokens, etc) to the LLM, so at this moment only the TransformersLLM, vLLM and InferenceEndpointsLLM uses the mixin and therefore are the only LLMs that can be used with the new tasks.

Finally, InferenceEndpointsLLM has been updated and the use_openai_client argument has been removed (and the use of the OpenAI client) as it was not used and didn't add any additional functionality that the huggingface_hub.AsyncInferenceClient doesn't offer. In addition, if tokenizer_id is not provided, then the chat_completion method from the huggingface_hub.AsyncInferenceClient is used instead of the text_generation. ⚠️ Even though with the new chat_generation methods a list of tools can be passed, we need to update the LLM.generate function signature and adapt the agenerate method so function calls can be returned too #782 (I'll tackle this in a different PR).

@gabrielmbmb gabrielmbmb added the enhancement New feature or request label Jul 10, 2024
@gabrielmbmb gabrielmbmb added this to the 1.3.0 milestone Jul 10, 2024
@gabrielmbmb gabrielmbmb requested a review from plaguss July 10, 2024 16:32
@gabrielmbmb gabrielmbmb self-assigned this Jul 10, 2024
Copy link

Documentation for this PR has been built. You can view it at: https://distilabel.argilla.io/pr-778/

Copy link

codspeed-hq bot commented Jul 10, 2024

CodSpeed Performance Report

Merging #778 will not alter performance

Comparing magpie (cd3cc5d) with develop (86d4e80)

Summary

✅ 1 untouched benchmarks

Copy link
Contributor

@plaguss plaguss left a comment

Choose a reason for hiding this comment

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

LGTM! will review again once it's ready for review 👍

src/distilabel/steps/tasks/magpie/base.py Outdated Show resolved Hide resolved
src/distilabel/steps/tasks/magpie/base.py Show resolved Hide resolved
src/distilabel/steps/tasks/magpie/base.py Outdated Show resolved Hide resolved
@gabrielmbmb gabrielmbmb marked this pull request as ready for review July 11, 2024 13:30
@gabrielmbmb gabrielmbmb linked an issue Jul 11, 2024 that may be closed by this pull request
@gabrielmbmb gabrielmbmb merged commit 4fc569d into develop Jul 15, 2024
7 checks passed
@gabrielmbmb gabrielmbmb deleted the magpie branch July 15, 2024 13:39
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.

[IMPLEMENTATION] magpie
2 participants