[!IMPORTANT]
原项目作者已转向其他项目。近期,一群社区成员成为该项目GitHub仓库的协作者,负责维护项目,并正积极推动下一个版本的发布。在此期间,可查看develop分支以获取最新的修复与改进。
Distilabel 是一个为工程师设计的合成数据与 AI 反馈框架,它能够基于经过验证的研究论文,快速、可靠且可扩展地构建流水线。
如果您想快速上手,我们推荐您查阅文档。好奇且想了解更多?请继续阅读!
Distilabel 可用于为各种项目生成合成数据和 AI 反馈,包括传统的预测性 NLP(分类、提取等)以及生成式或大语言模型场景(指令遵循、对话生成、评判等)。Distilabel 的程序化方法让您能够构建可扩展的数据生成和 AI 反馈流水线。其目标是基于经过验证的 AI 反馈研究与评判方法,快速生成高质量、多样化的数据集,从而加速您的 AI 开发。
计算成本高,输出质量同样重要。我们帮助您专注于数据质量,这能同时从根源解决这两个问题。Distilabel 帮助您合成和评判数据,让您将宝贵时间投入到实现并维持数据的高质量标准上。
微调自有 LLM 的数据所有权并非易事,但 Distilabel 可以帮助您入门。我们通过统一的 API,集成了来自任何 LLM 提供商的 AI 反馈。
基于最新研究论文合成和评判数据,同时确保灵活性、可扩展性和容错性。这样您可以专注于改进数据和训练模型。
我们是一个开源、社区驱动的项目,非常乐意听取您的意见。以下是一些参与方式:
社区聚会:在我们每两周一次的活动中旁听或进行演示。
Discord:在 #argilla-general 和 #argilla-help 频道获取社区的直接支持。
路线图:计划会变化,但我们乐于与社区讨论,欢迎您的参与。
Argilla 社区使用 Distilabel 创建了令人惊叹的数据集和模型。
pip install distilabel --upgrade
需要 Python 3.9+。
此外,还提供以下可选扩展包:
anthropic:通过 AnthropicLLM 集成使用 Anthropic API 中的模型。cohere:通过 CohereLLM 集成使用 Cohere 中的模型。argilla:用于将生成的数据集导出到 Argilla。groq:通过 GroqLLM 集成,使用 groq Python 客户端调用 Groq 中的模型。hf-inference-endpoints:通过 InferenceEndpointsLLM 集成使用 Hugging Face Inference Endpoints。hf-transformers:通过 TransformersLLM 集成使用 transformers 包中的模型。litellm:通过 LiteLLM 集成,使用 LiteLLM 以 OpenAI 格式调用任何 LLM。llama-cpp:通过 LlamaCppLLM 集成,使用 llama-cpp-python Python 绑定来调用 llama.cpp。mistralai:通过 MistralAILLM 集成使用 Mistral AI API 中的模型。ollama:通过 OllamaLLM 集成使用 Ollama 及其可用模型。openai:通过 OpenAILLM 集成使用 OpenAI API 模型,或通过基于 OpenAI 客户端构建的其他集成,如 AnyscaleLLM、AzureOpenAILLM 和 TogetherLLM。vertexai:通过 VertexAILLM 集成使用 Google Vertex AI 专有模型。vllm:通过 vLLM 集成使用 vllm 推理引擎。sentence-transformers:使用 sentence-transformers 生成句子嵌入。mlx:通过 MlxLLM 集成使用 MLX 模型。outlines:使用 outlines 进行 LLM 的结构化生成。instructor:使用 Instructor 进行 LLM 的结构化生成。ray:使用 Ray 扩展和分布式运行流水线。faiss-cpu 和 faiss-gpu:使用 faiss 生成句子嵌入。text-clustering:使用 UMAP 和 Scikit-learn 进行文本聚类。minhash:使用 datasketch 和 nltk 进行基于 MinHash 的重复检测。要运行以下示例,您需要安装带有 hf-inference-endpoints 扩展的 distilabel:
pip install "distilabel[hf-inference-endpoints]" --upgrade
然后运行:
from datasets import load_dataset
from distilabel.models import InferenceEndpointsLLM
from distilabel.pipeline import Pipeline
from distilabel.steps.tasks import TextGeneration
with Pipeline() as pipeline:
TextGeneration(
llm=InferenceEndpointsLLM(
model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
generation_kwargs={"temperature": 0.7, "max_new_tokens": 512},
),
)
if __name__ == "__main__":
dataset = load_dataset("distilabel-internal-testing/instructions", split="test")
distiset = pipeline.run(dataset=dataset)
distiset.push_to_hub(repo_id="distilabel-example")
如果您使用 distilabel 构建了很酷的项目,请考虑将以下徽章之一添加到您的数据集或模型卡片中。
[<img src="https://raw.githubusercontent.com/argilla-io/distilabel/main/docs/assets/distilabel-badge-light.png" alt="Built with Distilabel" width="200" height="32"/>](https://github.com/argilla-io/distilabel)
[<img src="https://raw.githubusercontent.com/argilla-io/distilabel/main/docs/assets/distilabel-badge-dark.png" alt="Built with Distilabel" width="200" height="32"/>](https://github.com/argilla-io/distilabel)
要直接为 distilabel 做贡献,请查看我们的 好首个议题 或新建一个议题。
@misc{distilabel-argilla-2024,
author = {Álvaro Bartolomé Del Canto and Gabriel Martín Blázquez and Agustín Piqueres Lajarín and Daniel Vila Suero},
title = {Distilabel: An AI Feedback (AIF) framework for building datasets with and for LLMs},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/argilla-io/distilabel}}
}