xusenlinzy / api-for-open-llm

Openai style api for open large language models, using LLMs just as chatgpt! Support for LLaMA, LLaMA-2, BLOOM, Falcon, Baichuan, Qwen, Xverse, SqlCoder, CodeLLaMA, ChatGLM, ChatGLM2, ChatGLM3 etc. 开源大模型的统一后端接口
Apache License 2.0
2.16k stars 252 forks source link

TypeError: 'NoneType' object is not subscriptable #243

Closed deauss2017 closed 2 months ago

deauss2017 commented 4 months ago

提交前必须检查以下项目 | The following items must be checked before submission

问题类型 | Type of problem

其他问题 | Other issues

操作系统 | Operating system

Linux

详细描述问题 | Detailed description of the problem

在streamlit前端输入太多的内容报错

TypeError: 'NoneType' object is not subscriptable
Traceback:
File "/data/Qwen/qwen14/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
File "/data/Qwen/api-for-open-llm/streamlit-demo/streamlit_app.py", line 63, in <module>
    main()
File "/data/Qwen/api-for-open-llm/streamlit-demo/streamlit_app.py", line 58, in main
    page.show()
File "/data/Qwen/api-for-open-llm/streamlit-demo/streamlit_gallery/utils/page.py", line 50, in show
    self._selected()
File "/data/Qwen/api-for-open-llm/streamlit-demo/streamlit_gallery/components/chat/streamlit_app.py", line 43, in main
    full_response += response.choices[0].delta.content or ""

这个是为什么,并且即使第一次不报错,在次输入同样内容时也会报上述错误

Dependencies

# 请在此处粘贴依赖情况
# Please paste the dependencies here

运行日志或截图 | Runtime logs or screenshots

# 请在此处粘贴运行日志
# Please paste the run log here