Qwen2.5 icon indicating copy to clipboard operation
Qwen2.5 copied to clipboard

qwen1.5-72b-chat content 结果被截断

Open 1920853199 opened this issue 10 months ago • 7 comments

input:

{
    "model": "qwen1.5-72b-chat",
    "temperature": 0,
    "maxTokens":8000,
    "stream": "false",
    "messages": [
        {
            "role": "system", "content": "Translate everything into Simplified Chinese. Please only include the translation result."
        },
         {"role": "user", "content": "Retrieval Augmented Generation, aka RAG, provides LLMs with the information retrieved from some data source to ground its generated answer on. Basically RAG is Search + LLM prompting, where you ask the model to answer the query provided the information found with the search algorithm as a context. Both the query and the retrieved context are injected into the prompt that is sent to the LLM."
        }
    ]
}

output:


{
    "id": "chatcmpl-36c2DT4bBSnCt29PgLGcu8",
    "object": "chat.completion",
    "created": 1711598218,
    "model": "qwen1.5-72b-chat",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "检索增强生成(RAG)是一种技术,它使LLMs(大型语言模型)能够利用从某些数据源检索到的信息来支持其生成的答案。简单来说,RAG就是搜索加LLM提示,其中你让模型在通过搜索算法找到的信息作为上下文的基础上回答问题。查询和检索到的上下文都会被融入到发"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 108,
        "total_tokens": 191,
        "completion_tokens": 83
    }
}

content 结果直接被截断了,有人遇到过吗,怎么解决

1920853199 avatar Mar 28 '24 04:03 1920853199

你是vllm跑的吗

njhouse365 avatar Apr 03 '24 05:04 njhouse365

你是vllm跑的吗

是的

1920853199 avatar Apr 03 '24 05:04 1920853199

Qwen1.5-14B-Chat 用的14B的,一样的问题,非流式生成会截断,流式的话就是正常的,fastchat+vllm部署的,换成baichuan就没问题

aimi0914 avatar Apr 08 '24 03:04 aimi0914

@1920853199 您好,可以提供一下vllm版本吗? 这个有可能是https://github.com/vllm-project/vllm/issues/3034导致的,在https://github.com/vllm-project/vllm/pull/3016中修复,该修复已并入vllm-0.3.3版本;您可以尝试下这个版本。

fyabc avatar Apr 08 '24 03:04 fyabc

@1920853199 您好,可以提供一下vllm版本吗? 这个有可能是vllm-project/vllm#3034导致的,在vllm-project/vllm#3016中修复,该修复已并入vllm-0.3.3版本;您可以尝试下这个版本。

升级可以了,不过低版本的vllm,用百川的模型就不会出现截断的问题,这是vllm的问题还是qwen和baichuan的差异呢

aimi0914 avatar Apr 08 '24 10:04 aimi0914

@1920853199 您好,可以提供一下vllm版本吗? 这个有可能是vllm-project/vllm#3034导致的,在vllm-project/vllm#3016中修复,该修复已并入vllm-0.3.3版本;您可以尝试下这个版本。

升级可以了,不过低版本的vllm,用百川的模型就不会出现截断的问题,这是vllm的问题还是qwen和baichuan的差异呢

如果您使用的是fastchat + vllm部署的话,这个是因为在fastchat的Conversation中,baichuan2未设置stop_token_idsstop_str,而qwen和yi等模型设置了这两个值,因此会受到这个bug的影响。(对话模板如此配置的具体原因,可以参考链接代码中指向的各个config配置文件)。

fyabc avatar Apr 09 '24 04:04 fyabc

@1920853199 您好,可以提供一下vllm版本吗? 这个有可能是vllm-project/vllm#3034导致的,在vllm-project/vllm#3016中修复,该修复已并入vllm-0.3.3版本;您可以尝试下这个版本。

升级可以了,不过低版本的vllm,用百川的模型就不会出现截断的问题,这是vllm的问题还是qwen和baichuan的差异呢

如果您使用的是fastchat + vllm部署的话,这个是因为在fastchat的Conversation中,baichuan2未设置stop_token_idsstop_str,而qwen和yi等模型设置了这两个值,因此会受到这个bug的影响。(对话模板如此配置的具体原因,可以参考链接代码中指向的各个config配置文件)。

thanks!

aimi0914 avatar Apr 09 '24 06:04 aimi0914