[Bug] 我用了最新版的latest-cu128,运行GLM-4.7-Flash,在opencode中使用报了下面的错误!
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
調査の方向性
lmdeploy/serve/openai/api_server.py から始め、serve/core/async_engine.py、serve/processors/multimodal.py、lmdeploy/model.py を通るリクエストパスを tokenizer の apply_chat_template 呼び出しまで追跡します。記載されている GLM-4.7-Flash 構成で、単一メッセージの OpenCode リクエストを再現し、その後、チャットテンプレートがオブジェクトを想定しているにもかかわらず文字列を受け取る理由を特定します;報告されている UndefinedError が発生せずにリクエストが完了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Checklist
- 1. I have searched related issues but cannot get the expected help.
- 2. The bug has not been fixed in the latest version.
- 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
Describe the bug
这个是参数不对吗?
我只使用了
environment:
CUDA_VISIBLE_DEVICES: "0,1,2,3"
CUDA_DEVICE_ORDER: "PCI_BUS_ID"
NCCL_DEBUG: "WARN"
NCCL_P2P_LEVEL: "NVL"
NCCL_P2P_DISABLE: "0"
NCCL_SHM_DISABLE: "0"
NCCL_IB_DISABLE: "0"
NCCL_SOCKET_IFNAME: "eth0"
NCCL_TIMEOUT: "1800"
NCCL_NVLS_ENABLE: "1"
CUDA_LAUNCH_BLOCKING: "0"
CUDA_DEVICE_MAX_CONNECTIONS: "32"
OMP_NUM_THREADS: "8"
OMP_PROC_BIND: "close"
OMP_PLACES: "cores"
TOKENIZERS_PARALLELISM: "false"
ipc: host
shm_size: "32gb"
cpuset: "0-23,48-71"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9991:8000"
volumes:
- /data/ai/models/vllm:/models
- /tmp/lmdeploy_cache_1:/root/.cache
command: >
lmdeploy serve api_server
/models/GLM-4.7-Flash-AWQ
--model-name GLM_4.7_30B
--server-name 0.0.0.0
--server-port 8000
--backend turbomind
--tp 4
--session-len 102400
--log-level INFO
--communicator nccl
在opencode中使用,只发了一句你好, 但是报了下面的错误。
Reproduction
在oepncode中使用,使用的上面的配置
Environment
docker:latest-cu128
Error traceback
ERROR: Exception in ASGI application
+ Exception Group Traceback (most recent call last):
| File "/opt/py3/lib/python3.10/site-packages/starlette/_utils.py", line 81, in collapse_excgroups
| yield
| File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 274, in __call__
| async with anyio.create_task_group() as task_group:
| File "/opt/py3/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 783, in __aexit__
| raise BaseExceptionGroup(
| exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/opt/py3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 410, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| File "/opt/py3/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
| return await self.app(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/fastapi/applications.py", line 1159, in __call__
| await super().__call__(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/applications.py", line 90, in __call__
| await self.middleware_stack(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
| raise exc
| File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
| await self.app(scope, receive, _send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/cors.py", line 88, in __call__
| await self.app(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
| raise exc
| File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
| await app(scope, receive, sender)
| File "/opt/py3/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
| await self.app(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/routing.py", line 660, in __call__
| await self.middleware_stack(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/routing.py", line 680, in app
| await route.handle(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
| await self.app(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/fastapi/routing.py", line 134, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
| raise exc
| File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
| await app(scope, receive, sender)
| File "/opt/py3/lib/python3.10/site-packages/fastapi/routing.py", line 121, in app
| await response(scope, receive, send)
| File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 273, in __call__
| with collapse_excgroups():
| File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
| self.gen.throw(typ, value, traceback)
| File "/opt/py3/lib/python3.10/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
| raise exc
| File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 277, in wrap
| await func()
| File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 250, in stream_response
| async for chunk in self.body_iterator:
| File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/openai/api_server.py", line 516, in completion_stream_generator
| async for res in result_generator:
| File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/core/async_engine.py", line 335, in generate
| prompt_input = await self.prompt_processor.get_prompt_input(prompt=prompt,
| File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/processors/multimodal.py", line 206, in get_prompt_input
| return await self._get_text_prompt_input(prompt=prompt,
| File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/processors/multimodal.py", line 333, in _get_text_prompt_input
| prompt = chat_template.messages2prompt(prompt,
| File "/opt/py3/lib/python3.10/site-packages/lmdeploy/model.py", line 724, in messages2prompt
| prompt = self.tokenizer.apply_chat_template(messages,
| File "/opt/py3/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 3063, in apply_chat_template
| rendered_chat, generation_indices = render_jinja_template(
| File "/opt/py3/lib/python3.10/site-packages/transformers/utils/chat_template_utils.py", line 555, in render_jinja_template
| rendered_chat = compiled_template.render(
| File "/opt/py3/lib/python3.10/site-packages/jinja2/environment.py", line 1295, in render
| self.environment.handle_exception()
| File "/opt/py3/lib/python3.10/site-packages/jinja2/environment.py", line 942, in handle_exception
| raise rewrite_traceback_stack(source=source)
| File "<template>", line 56, in top-level template code
| File "/opt/py3/lib/python3.10/site-packages/jinja2/sandbox.py", line 399, in call
| if not __self.is_safe_callable(__obj):
| File "/opt/py3/lib/python3.10/site-packages/jinja2/sandbox.py", line 265, in is_safe_callable
| getattr(obj, "unsafe_callable", False) or getattr(obj, "alters_data", False)
| jinja2.exceptions.UndefinedError: 'str object' has no attribute 'items'
+------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/py3/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 410, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/opt/py3/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/fastapi/applications.py", line 1159, in __call__
await super().__call__(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/applications.py", line 90, in __call__
await self.middleware_stack(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
raise exc
File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
await self.app(scope, receive, _send)
File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/cors.py", line 88, in __call__
await self.app(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/opt/py3/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/routing.py", line 660, in __call__
await self.middleware_stack(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/routing.py", line 680, in app
await route.handle(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/fastapi/routing.py", line 134, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/opt/py3/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/opt/py3/lib/python3.10/site-packages/fastapi/routing.py", line 121, in app
await response(scope, receive, send)
File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 273, in __call__
with collapse_excgroups():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/opt/py3/lib/python3.10/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
raise exc
File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 277, in wrap
await func()
File "/opt/py3/lib/python3.10/site-packages/starlette/responses.py", line 250, in stream_response
async for chunk in self.body_iterator:
File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/openai/api_server.py", line 516, in completion_stream_generator
async for res in result_generator:
File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/core/async_engine.py", line 335, in generate
prompt_input = await self.prompt_processor.get_prompt_input(prompt=prompt,
File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/processors/multimodal.py", line 206, in get_prompt_input
return await self._get_text_prompt_input(prompt=prompt,
File "/opt/py3/lib/python3.10/site-packages/lmdeploy/serve/processors/multimodal.py", line 333, in _get_text_prompt_input
prompt = chat_template.messages2prompt(prompt,
File "/opt/py3/lib/python3.10/site-packages/lmdeploy/model.py", line 724, in messages2prompt
prompt = self.tokenizer.apply_chat_template(messages,
File "/opt/py3/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 3063, in apply_chat_template
rendered_chat, generation_indices = render_jinja_template(
File "/opt/py3/lib/python3.10/site-packages/transformers/utils/chat_template_utils.py", line 555, in render_jinja_template
rendered_chat = compiled_template.render(
File "/opt/py3/lib/python3.10/site-packages/jinja2/environment.py", line 1295, in render
self.environment.handle_exception()
File "/opt/py3/lib/python3.10/site-packages/jinja2/environment.py", line 942, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 56, in top-level template code
File "/opt/py3/lib/python3.10/site-packages/jinja2/sandbox.py", line 399, in call
if not __self.is_safe_callable(__obj):
File "/opt/py3/lib/python3.10/site-packages/jinja2/sandbox.py", line 265, in is_safe_callable
getattr(obj, "unsafe_callable", False) or getattr(obj, "alters_data", False)
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'items'
- 主要言語
- Python
- スター
- 8.2k
- フォーク
- 797
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 52
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InternLM/lmdeploy のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 2 日以内に返信
-
[Bug] apply_rotary_pos_emb: leaves output tails unwritten with partial rotation対応中かも @shotsan が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Bug] PyTorch engine ignores use_rslora, so rsLoRA adapters run sqrt(r) times too weak対応中かも @Andreas-Hum が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Feature] Expose `max_model_len` (session_len) in `/v1/models` model card対応中かも @FOWEPJF255 が 37 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 2 日以内に返信
InternLM/lmdeploy の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Techiebutler/freeframe#687 ·
メンテナーはふだん 1 日以内に返信
-
bug verbose GC
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
IBM/javacore-analyser#677 ·
メンテナーはふだん 1 日以内に返信
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#163932 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's file対応中かも @Beehtrix が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
zilliztech/memsearch#907 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
langchain-ai/docs#8386 ·
メンテナーはふだん 1 日以内に返信