8000 [BUG] 多轮对话的 prompt 应该如何构建? · Issue #81 · QwenLM/qwen.cpp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
[BUG] 多轮对话的 prompt 应该如何构建? #81
Open
@791136190

Description

@791136190

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

在你们给出的cpp示例中,auto QwenTokenizer::build_prompt(const std::vector<std::string> &history) const -> std::string { 这个函数指出,如果是多轮对话时,会重新构建user和assistant的信息。但是构建历史assistant信息的时候使用的是<|im_start|>" << history[i + 1] << "<|im_end|>",而不是使用<|im_start|>assistant\n" << history[i + 1] << "<|im_end|>"。这样会导致无法在多轮对话行中使用kv cache,每次必须要重新构建prompt,然后生成新的kv cache。我的理解是合理的吗?

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0