CogAgent icon indicating copy to clipboard operation
CogAgent copied to clipboard

vllm支持的有问题 ,总是返回Grounded de

Open bikesharing opened this issue 10 months ago • 13 comments

System Info / 系統信息

使用vllm代码示例,推理的结果总是Grounded de,是啥原因?

Who can help? / 谁可以帮助到您?

No response

Information / 问题信息

  • [ ] The official example scripts / 官方的示例脚本
  • [ ] My own modified scripts / 我自己修改的脚本和任务

Reproduction / 复现过程

from PIL import Image from vllm import LLM, SamplingParams

model_name = "THUDM/cogagent-9b-20241220"

def procress_inputs(): task = "Mark emails as read" platform_str = "(Platform: Mac)\n" history_str = "\nHistory steps: " format_str = "(Answer in Action-Operation-Sensitive format.)" query = f"Task: {task}{history_str}\n{platform_str}{format_str}" return query

llm = LLM(model=model_name, tensor_parallel_size=1, max_model_len=8192, trust_remote_code=True, enforce_eager=True) stop_token_ids = [151329, 151336, 151338] sampling_params = SamplingParams(temperature=0.2, max_tokens=1024, stop_token_ids=stop_token_ids)

prompt = procress_inputs() image = Image.open("your image.png").convert('RGB') inputs = { "prompt": prompt, "multi_modal_data": { "image": image }, } outputs = llm.generate(inputs, sampling_params=sampling_params)

for o in outputs: generated_text = o.outputs[0].text print(generated_text)

Expected behavior / 期待表现

vllm框架推理结果总是Grounded de,是啥原因?

bikesharing avatar Feb 22 '25 01:02 bikesharing

你这个输出是不是不完整

sixsixcoder avatar Feb 24 '25 06:02 sixsixcoder

是完整的,直接打印response,用你们给的app里面的openai_demo.py是好的

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2025年2月24日(星期一) 下午2:52 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [THUDM/CogAgent] vllm支持的有问题 ,总是返回Grounded de (Issue #43)

你这个输出是不是不完整

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> sixsixcoder left a comment (THUDM/CogAgent#43)

你这个输出是不是不完整

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

bikesharing avatar Feb 24 '25 06:02 bikesharing

vllm推理你们测试过吗?

bikesharing avatar Feb 24 '25 06:02 bikesharing

vllm要用最新版

sixsixcoder avatar Feb 24 '25 07:02 sixsixcoder

使用vllm 0.7.2版本是可以的。最新版0.7.3不可用。谢谢。另外,vllm启动参数很多,真的咱们的模型,有没有推荐的启动参数命令行?

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2025年2月24日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [THUDM/CogAgent] vllm支持的有问题 ,总是返回Grounded de (Issue #43)

vllm要用最新版

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> sixsixcoder left a comment (THUDM/CogAgent#43)

vllm要用最新版

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

bikesharing avatar Feb 25 '25 01:02 bikesharing

启动参数就这些vllm_openai_server.py

def load_model(model_dir: str):
    engine_args = AsyncEngineArgs(
        model=model_dir,
        tensor_parallel_size=1,
        dtype="bfloat16",
        trust_remote_code=True,
        gpu_memory_utilization=0.9,
        enforce_eager=True,
        worker_use_ray=True,
        disable_log_requests=True,
        # 如果遇见 OOM 现象,建议开启下述参数
        # enable_chunked_prefill=True,
        # max_num_batched_tokens=8192
    )
    engine = AsyncLLMEngine.from_engine_args(engine_args)
    return engine

sixsixcoder avatar Feb 28 '25 11:02 sixsixcoder

is CogAgent support vLLM officially?

leeaction avatar Mar 05 '25 04:03 leeaction

is CogAgent support vLLM officially?

sure

sixsixcoder avatar Mar 10 '25 06:03 sixsixcoder

使用vllm的版本到底是多少呀,我用0.7.2以及0.6.6都不行

Mars-1990 avatar Mar 11 '25 07:03 Mars-1990

使用vllm的版本到底是多少呀,我用0.7.2以及0.6.6都不行

理论上0.6.6以后都可以,你遇到什么问题,可以新开一个issue讨论

sixsixcoder avatar Mar 12 '25 03:03 sixsixcoder

@sixsixcoder 请问您在使用运行启动 vllm_openai_server.py有修改哪些内容吗,我的会报这个错:ValueError: ChatGLMForConditionalGeneration has no vLLM implementation and the Transformers implementation is not compatible with vLLM.,看起来像是vllm不支持cogagent. vllm注册新模型的文档也不是很清晰:https://vllm.hyper.ai/docs/models/adding-a-new-model#1-%E5%BC%95%E5%85%A5%E4%BD%A0%E7%9A%84%E6%A8%A1%E5%9E%8B%E4%BB%A3%E7%A0%81 您能告诉我要改哪些内容吗,期待您的回复,谢谢

我的环境是: 华为npu:910B python3.10.12 vllm0.7.3+empty torch2.5.1 transformers4.50.1


我按照自己的理解修改了相关内容,模型成功启动,但是调用模型输出为空: https://bgithub.xyz/THUDM/CogAgent/issues/49

yujin2021 avatar Apr 03 '25 01:04 yujin2021

目前看还是不要使用vllm了,支持的不好。

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2025年4月3日(星期四) 上午9:05 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [THUDM/CogAgent] vllm支持的有问题 ,总是返回Grounded de (Issue #43)

@sixsixcoder 请问您在使用运行启动 vllm_openai_server.py有修改哪些内容吗,我的会报这个错:ValueError: ChatGLMForConditionalGeneration has no vLLM implementation and the Transformers implementation is not compatible with vLLM.,看起来像是vllm不支持cogagent. vllm注册新模型的文档也不是很清晰:https://vllm.hyper.ai/docs/models/adding-a-new-model#1-%E5%BC%95%E5%85%A5%E4%BD%A0%E7%9A%84%E6%A8%A1%E5%9E%8B%E4%BB%A3%E7%A0%81 您能告诉我要改哪些内容吗,期待您的回复,谢谢

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> yujin2021 left a comment (THUDM/CogAgent#43)

@sixsixcoder 请问您在使用运行启动 vllm_openai_server.py有修改哪些内容吗,我的会报这个错:ValueError: ChatGLMForConditionalGeneration has no vLLM implementation and the Transformers implementation is not compatible with vLLM.,看起来像是vllm不支持cogagent. vllm注册新模型的文档也不是很清晰:https://vllm.hyper.ai/docs/models/adding-a-new-model#1-%E5%BC%95%E5%85%A5%E4%BD%A0%E7%9A%84%E6%A8%A1%E5%9E%8B%E4%BB%A3%E7%A0%81 您能告诉我要改哪些内容吗,期待您的回复,谢谢

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

bikesharing avatar Apr 09 '25 03:04 bikesharing

    感谢给大家带来这么好的大模型。我把在应用中遇到的严重问题给您反馈一下。     问题1:目前我们用了8块nvidia 4090,使用openai_demo.py文件启动服务,运行一段时间,服务会卡住,就是不响应,需要重启服务。     问题2:用了vllm(0.7.2)来部署,推理速度快了不少,由15秒左右降到10秒左右,但推理结果有问题,见截图:明明是桌面,却说当前是登录界面。

推理结果:

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2025年2月24日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [THUDM/CogAgent] vllm支持的有问题 ,总是返回Grounded de (Issue #43)

vllm要用最新版

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***> sixsixcoder left a comment (THUDM/CogAgent#43)

vllm要用最新版

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

bikesharing avatar Apr 11 '25 01:04 bikesharing