optimize_qa_mapper¶
Mapper to optimize question-answer pairs.
This operator refines and enhances the quality of question-answer pairs. It uses a Hugging Face model to generate more detailed and accurate questions and answers. The input is formatted using a template, and the output is parsed using a regular expression. The system prompt, input template, and output pattern can be customized. If VLLM is enabled, the operator accelerates inference on CUDA devices.
优化问答对的映射器。
该算子改进和提高问答对的质量。它使用Hugging Face模型生成更详细和准确的问题和答案。输入使用模板格式化,输出通过正则表达式解析。可以自定义系统提示、输入模板和输出模式。如果启用了VLLM,算子将在CUDA设备上加速推理。
Type 算子类型: mapper
Tags 标签: cpu, vllm, hf
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
---|---|---|---|
|
<class ‘str’> |
|
Hugging Face model ID. |
|
typing.Optional[str] |
|
System prompt for guiding the optimization task. |
|
typing.Optional[str] |
|
Template for building the input for the model. |
|
typing.Optional[str] |
|
Template for formatting the question and |
|
typing.Optional[str] |
|
Regular expression pattern to extract question |
|
<class ‘bool’> |
|
Whether to use VLLM for inference acceleration. |
|
typing.Optional[typing.Dict] |
|
Parameters for initializing the model. |
|
typing.Optional[typing.Dict] |
|
Sampling parameters for text generation (e.g., |
|
|
Extra keyword arguments. |
📊 Effect demonstration 效果演示¶
not available 暂无