Skip to content

vllm部署失败 AttributeError: 'dict' object has no attribute 'model_type' #42

@shatang123

Description

@shatang123

启动命令:vllm serve "/home/user01/vllm/model/RUC-DataLab/DeepAnalyze-8B" --host 0.0.0.0 --port 18003

错误日志

(APIServer pid=2114544) INFO 11-25 17:08:47 [api_server.py:1977] vLLM API server version 0.11.2
(APIServer pid=2114544) INFO 11-25 17:08:47 [utils.py:253] non-default args: {'model_tag': '/home/user01/vllm/model/RUC-DataLab/DeepAnalyze-8B', 'host': '0.0.0.0', 'port': 18003, 'model': '/home/user01/vllm/model/RUC-DataLab/DeepAnalyze-8B'}
(APIServer pid=2114544) Unrecognized keys in `rope_scaling` for 'rope_type'='yarn': {'attn_factor'}
(APIServer pid=2114544) INFO 11-25 17:08:47 [model.py:631] Resolved architecture: Qwen3ForCausalLM
(APIServer pid=2114544) INFO 11-25 17:08:47 [model.py:1745] Using max model len 131072
(APIServer pid=2114544) INFO 11-25 17:08:47 [scheduler.py:216] Chunked prefill is enabled with max_num_batched_tokens=2048.
(APIServer pid=2114544) Traceback (most recent call last):
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/bin/vllm", line 10, in <module>
(APIServer pid=2114544)     sys.exit(main())
(APIServer pid=2114544)              ^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/entrypoints/cli/main.py", line 73, in main
(APIServer pid=2114544)     args.dispatch_function(args)
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/entrypoints/cli/serve.py", line 60, in cmd
(APIServer pid=2114544)     uvloop.run(run_server(args))
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/uvloop/__init__.py", line 96, in run
(APIServer pid=2114544)     return __asyncio.run(
(APIServer pid=2114544)            ^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 195, in run
(APIServer pid=2114544)     return runner.run(main)
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/asyncio/runners.py", line 118, in run
(APIServer pid=2114544)     return self._loop.run_until_complete(task)
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/uvloop/__init__.py", line 48, in wrapper
(APIServer pid=2114544)     return await main
(APIServer pid=2114544)            ^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 2024, in run_server
(APIServer pid=2114544)     await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 2043, in run_server_worker
(APIServer pid=2114544)     async with build_async_engine_client(
(APIServer pid=2114544)                ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=2114544)     return await anext(self.gen)
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 195, in build_async_engine_client
(APIServer pid=2114544)     async with build_async_engine_client_from_engine_args(
(APIServer pid=2114544)                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=2114544)     return await anext(self.gen)
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 236, in build_async_engine_client_from_engine_args
(APIServer pid=2114544)     async_llm = AsyncLLM.from_vllm_config(
(APIServer pid=2114544)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/utils/func_utils.py", line 116, in inner
(APIServer pid=2114544)     return fn(*args, **kwargs)
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 203, in from_vllm_config
(APIServer pid=2114544)     return cls(
(APIServer pid=2114544)            ^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 114, in __init__
(APIServer pid=2114544)     tokenizer = init_tokenizer_from_configs(self.model_config)
(APIServer pid=2114544)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/transformers_utils/tokenizer.py", line 287, in init_tokenizer_from_configs
(APIServer pid=2114544)     return get_tokenizer(
(APIServer pid=2114544)            ^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/vllm/transformers_utils/tokenizer.py", line 213, in get_tokenizer
(APIServer pid=2114544)     tokenizer = AutoTokenizer.from_pretrained(
(APIServer pid=2114544)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/transformers/models/auto/tokenization_auto.py", line 1156, in from_pretrained
(APIServer pid=2114544)     return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 2112, in from_pretrained
(APIServer pid=2114544)     return cls._from_pretrained(
(APIServer pid=2114544)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544)   File "/home/user01/vllm/.venv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 2419, in _from_pretrained
(APIServer pid=2114544)     if _is_local and _config.model_type not in [
(APIServer pid=2114544)                      ^^^^^^^^^^^^^^^^^^
(APIServer pid=2114544) AttributeError: 'dict' object has no attribute 'model_type'

transformers版本

Name: transformers
Version: 4.57.2
Location: /home/user01/vllm/.venv/lib/python3.12/site-packages
Requires: filelock, huggingface-hub, numpy, packaging, pyyaml, regex, requests, safetensors, tokenizers, tqdm
Required-by: compressed-tensors, vllm, xgrammar

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