Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AttributeError: 'Body' object has no attribute 'llm'

オープン
#52 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
fastapi, python
領域
ai, api, backend

調査の方向性

examples/webui/utils.py と _fastapi_stream2generator から開始し、次に stack trace に示されている chat_iterator と getChatModelFromConfig への呼び出しを追跡します。報告されたポートでローカルの ChatGLM2-6B セットアップを再現し、なぜ Body がモデル設定の検索に到達するのかを特定します。リクエストが AttributeError なしでモデル出力を生成すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Checked other resources
  • I searched the Codefuse documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in Codefuse-Repos rather than my code.
  • I added a very descriptive title to this issue.
System Info

Windows

Code Version

Latest Release

Description

在尝试连接本地chatglm2-6b模型时,输入任何问题都没有输出,终端出现如下报错。8000端口,项目里给的默认端口是8888,我运行了fastchat,改成了8000,同时模型端口也改成了21002(fastchat中modelworker的端口)

出现这样的问题是本地模型没有连上吗?

Example Code

问题大概出现在这里:

def _fastapi_stream2generator(self, response: StreamingResponse, as_json: bool =False):
'''
将api.py中视图函数返回的StreamingResponse转化为同步生成器
'''
try:
loop = asyncio.get_event_loop()
except:
loop = asyncio.new_event_loop()

    try:
        for chunk in  iter_over_async(response.body_iterator, loop):
            if as_json and chunk:
                yield json.loads(chunk)
            elif chunk.strip():
                yield chunk
    except Exception as e:
        logger.error(traceback.format_exc())
Error Message and Stack Trace (if applicable)

2024-10-07 22:00:10,718 - _client.py[line:1038] - INFO: HTTP Request: GET http://127.0.0.1:7862/sdfiles/list "HTTP/1.1 200 OK"
2024-10-07 22:00:11,154 - _client.py[line:1038] - INFO: HTTP Request: GET http://127.0.0.1:7862/sdfiles/download?filename=&save_filename= "HTTP/1.1 200 OK"
2024-10-07 22:00:11.191 | DEBUG | webui.dialogue:dialogue_page:294 - prompt: 你好
2024-10-07 22:00:11.674 | ERROR | webui.utils:_fastapi_stream2generator:252 - Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\codefuse-chatbot\examples\webui\utils.py", line 246, in _fastapi_stream2generator
for chunk in iter_over_async(response.body_iterator, loop):
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\muagent\utils\server_utils.py", line 120, in iter_over_async
done, obj = loop.run_until_complete(get_next())
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\muagent\utils\server_utils.py", line 115, in get_next
obj = await ait.anext()
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\starlette\concurrency.py", line 63, in iterate_in_threadpool
yield await anyio.to_thread.run_sync(_next, iterator)
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\anyio_backends_asyncio.py", line 2405, in run_sync_in_worker_thread
return await future
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\anyio_backends_asyncio.py", line 914, in run
result = context.run(func, *args)
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\starlette\concurrency.py", line 53, in _next
return next(iterator)
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\muagent\chat\base_chat.py", line 80, in chat_iterator
model = getChatModelFromConfig(llm_config)
File "C:\Users\Lenovo.conda\envs\devopsgpt\lib\site-packages\muagent\llm_models\openai_model.py", line 117, in getChatModelFromConfig
if llm_config and llm_config.llm and isinstance(llm_config.llm, LLM):
AttributeError: 'Body' object has no attribute 'llm'

主要言語
Python
スター
1.3k
フォーク
148
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codefuse-ai/codefuse-chatbot のほかの issue

codefuse-ai/codefuse-chatbot の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。