modelscope-agent icon indicating copy to clipboard operation
modelscope-agent copied to clipboard

TypeError: Can't instantiate abstract class Vllm with abstract method _chat_no_stream

Open chuanzhubin-aiopx opened this issue 8 months ago • 2 comments

Initial Checks

  • [X] I have searched GitHub for a duplicate issue and I'm sure this is something new
  • [X] I have read and followed the docs & demos and still think this is a bug
  • [X] I am confident that the issue is with modelscope-agent (not my code, or another library in the ecosystem)

What happened + What you expected to happen

报错日志

INFO:     127.0.0.1:51678 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "/home/czb/miniconda3/envs/ds/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/czb/git/modelscope-agent/modelscope_agent_servers/assistant_server/api.py", line 151, in chat_completion
    agent = RolePlay(function_list=None, llm=llm_config, uuid_str=user)
  File "/home/czb/git/modelscope-agent/modelscope_agent/agents/role_play.py", line 145, in __init__
    Agent.__init__(self, function_list, llm, storage_path, name,
  File "/home/czb/git/modelscope-agent/modelscope_agent/agent.py", line 43, in __init__
    self.llm = get_chat_model(**self.llm_config)
  File "/home/czb/git/modelscope-agent/modelscope_agent/llm/__init__.py", line 22, in get_chat_model
    return LLM_REGISTRY[model_server](model, model_server, **kwargs)
TypeError: Can't instantiate abstract class Vllm with abstract method _chat_no_stream

Versions / Dependencies

modelscope-agent== 0.6.0 Python 3.10.14 Ubuntu 22.04.4 LTS

Reproduction script

服务器端启动脚本:

bash scripts/run_assistant_server.sh --served-model-name qwen --model qwen/Qwen2-72B-Instruct-GPTQ-Int8

客户端脚本:

curl -X POST 'http://localhost:31512/v1/chat/completions' \
-H 'Content-Type: application/json' \
-d '{
    "tools": [{
        "type": "function",
        "function": {
            "name": "amap_weather",
            "description": "amap weather tool",
            "parameters": [{
                "name": "location",
                "type": "string",
                "description": "城市/区具体名称,如`北京市海淀区`请描述为`海淀区`",
                "required": true
            }]
        }
    }],
    "tool_choice": "auto",
    "model": "wall-e",
    "messages": [
        {"content": "海淀区天气", "role": "user"}
    ]
}'

Issue Severity

High: It blocks me from completing my task.

chuanzhubin-aiopx avatar Jun 07 '24 08:06 chuanzhubin-aiopx