Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署完成后运行出现一个问题KeyError: 'choices' #13

Open
GinRyan opened this issue Aug 16, 2024 · 1 comment
Open

部署完成后运行出现一个问题KeyError: 'choices' #13

GinRyan opened this issue Aug 16, 2024 · 1 comment

Comments

@GinRyan
Copy link

GinRyan commented Aug 16, 2024

部署方式按照文档部署,运行通过Python app.py执行,在发送消息时出现以下错误。

Snipaste_2024-08-16_10-19-47

KeyError: 'choices'
Traceback:
File "/root/miniconda3/envs/OculiChatDA/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
result = func()
File "/root/miniconda3/envs/OculiChatDA/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec
exec(code, module.dict)
File "/root/OculiChatDA/web_demo.py", line 380, in
main()
File "/root/OculiChatDA/web_demo.py", line 334, in main
for agent_return in st.session_state['chatbot'].stream_chat(
File "/root/OculiChatDA/utils/internlm2_agent.py", line 305, in stream_chat
for model_state, res, _ in self._llm.stream_chat(prompt, **kwargs):
File "/root/miniconda3/envs/OculiChatDA/lib/python3.10/site-packages/lagent/llms/lmdepoly_wrapper.py", line 422, in stream_chat
resp += text['choices'][0]['text']

@JieGenius
Copy link
Owner

JieGenius commented Aug 16, 2024

  1. 消息框只发文字会报错吗?
  2. 麻烦提供下所有包的版本,我尝试复线下。
    参考命令pip freeze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants