Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop导致llm输出不完整 #379

Open
ccran opened this issue Oct 17, 2024 · 3 comments
Open

stop导致llm输出不完整 #379

ccran opened this issue Oct 17, 2024 · 3 comments

Comments

@ccran
Copy link

ccran commented Oct 17, 2024

环境

  • vllm:0.6.1.post1
  • llm:Qwen2.5-72B-Instruct-GPTQ-Int4
  • openai: 1.42.0
  • qwen-agent: 0.0.10

运行代码

llm = {'model': 'Qwen2.5-72B-Instruct-GPTQ-Int4', 'model_server': 'http://192.168.252.70:9002/v1',
       'generate_cfg': {'temperature': 0.01, 'max_tokens': 2000}}


def test():
    bot = Assistant(llm=llm)
    messages = [{'role': 'user', 'content': '你是谁'}]
    for rsp in bot.run(messages):
        print(rsp)

输出

{'temperature': 0.01, 'max_tokens': 2000, 'stop': ['✿RESULT✿', '✿RETURN✿'], 'seed': 1061424198}
[{'role': 'assistant', 'content': '我是阿里云开发的一款超大规模语言模型,'}]

问题

大模型的输出不完整,我在oai.py把generate_cfg['stop'] = []设置为空后,输出正常。

@tuhahaha
Copy link
Collaborator

您好,我本地无法复现这个case,请问您那里是必现吗?另外,我看您这里并没有指定function,应该不会出现['✿RESULT✿', '✿RETURN✿']这种stopwords才对

@ccran
Copy link
Author

ccran commented Nov 4, 2024

您好,我本地无法复现这个case,请问您那里是必现吗?另外,我看您这里并没有指定function,应该不会出现['✿RESULT✿', '✿RETURN✿']这种stopwords才对

1、是必现的。
2、没有指定function,我只是想试下RAG效果。
我debug看了下stopwords设置的地方,应该是下面这两个路径。

文件:qwen_agent/llm/function_calling.py的18行设置的stopwords
文件:qwen_agent/llm/fncall_prompts/qwen_fncall_prompt.py
image

@xianjhuang
Copy link

请问这个bug怎么修复? 我也遇到了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants