跳到内容

URIAL

使用非指令微调模型生成响应。

URIAL 是一个预定义的任务,它使用非指令微调模型生成响应。此任务用于根据作为输入提供的对话生成响应。

输入 & 输出列

graph TD
    subgraph Dataset
        subgraph Columns
            ICOL0[instruction]
            ICOL1[conversation]
        end
        subgraph New columns
            OCOL0[generation]
            OCOL1[model_name]
        end
    end

    subgraph URIAL
        StepInput[Input Columns: instruction, conversation]
        StepOutput[Output Columns: generation, model_name]
    end

    ICOL0 --> StepInput
    ICOL1 --> StepInput
    StepOutput --> OCOL0
    StepOutput --> OCOL1
    StepInput --> StepOutput

输入

  • instruction (str, 可选): 从中生成响应的指令。

  • conversation (List[Dict[str, str]], 可选): 从中生成响应的对话(最后一条消息必须来自用户)。

输出

  • generation (str): 生成的响应。

  • model_name (str): 用于生成响应的模型的名称。

示例

从指令生成文本

from distilabel.models import vLLM
from distilabel.steps.tasks import URIAL

step = URIAL(
    llm=vLLM(
        model="meta-llama/Meta-Llama-3.1-8B",
        generation_kwargs={"temperature": 0.7},
    ),
)

step.load()

results = next(
    step.process(inputs=[{"instruction": "What's the most most common type of cloud?"}])
)
# [
#     {
#         'instruction': "What's the most most common type of cloud?",
#         'generation': 'Clouds are classified into three main types, high, middle, and low. The most common type of cloud is the middle cloud.',
#         'distilabel_metadata': {...},
#         'model_name': 'meta-llama/Meta-Llama-3.1-8B'
#     }
# ]

参考文献