chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
31.57k stars 5.51k forks source link

AttributeError: 'Markdown' object has no attribute 'content' #1658

Closed toby911 closed 12 months ago

toby911 commented 1 year ago

**问题描述 webui页面每次发送第二个问题 报错以下问题

AttributeError: 'Markdown' object has no attribute 'content' Traceback: File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in _run_script exec(code, module.dict) File "D:\mypyfiles\llm_code\Langchain-Chatchat-new\webui.py", line 66, in pages[selected_page]"func" File "D:\mypyfiles\llm_code\Langchain-Chatchat-new\webui_pages\dialogue\dialogue.py", line 145, in dialogue_page history = get_messages_history(history_len) File "D:\mypyfiles\llm_code\Langchain-Chatchat-new\webui_pages\dialogue\dialogue.py", line 36, in get_messages_history return chat_box.filter_history(history_len=history_len, filter=filter) File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit_chatbox\messages.py", line 120, in filter_history filtered = filter(msg) File "D:\mypyfiles\llm_code\Langchain-Chatchat-new\webui_pages\dialogue\dialogue.py", line 29, in filter content = [x.content for x in content] File "D:\mypyfiles\llm_code\Langchain-Chatchat-new\webui_pages\dialogue\dialogue.py", line 29, in content = [x.content for x in content]

liunux4odoo commented 1 year ago

一般这种问题都是streamlit-chatbox版本不对,你确认一下运行的虚拟环境是否正确,或者把streamlit-chatbox删掉重装试试。

milepost-njh commented 1 year ago

modify file:
vim Langchain-Chatchat/webui_pages/dialogue/dialogue.py +29

content = [x.content for x in content] => content = [x._content for x in content]

zyhui98 commented 12 months ago

en, 重新install就好了。