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

知识库and搜索引擎对话报错TypeError: MarkdownMixin.markdown() got an unexpected keyword argument 'state' #1730

Closed toby911 closed 12 months ago

toby911 commented 1 year ago

前端报错信息: TypeError: MarkdownMixin.markdown() got an unexpected keyword argument 'state' 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 205, in dialogue_page chat_box.ai_say([ File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit_chatbox\messages.py", line 274, in ai_say element() File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit_chatbox\elements.py", line 71, in call return super().call() File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit_chatbox\elements.py", line 48, in call self._dg = output_method(*self._args, *self._kwargs) File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit\runtime\metrics_util.py", line 367, in wrapped_func result = non_optional_func(args, **kwargs)

后端报错信息如下: File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit_chatbox\elements.py", line 71, in call return super().call() File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit_chatbox\elements.py", line 48, in call self._dg = output_method(*self._args, *self._kwargs) File "D:\Anaconda3\envs\py310\lib\site-packages\streamlit\runtime\metrics_util.py", line 367, in wrapped_func result = non_optional_func(args, **kwargs) TypeError: MarkdownMixin.markdown() got an unexpected keyword argument 'state'

环境信息 / Environment Information 操作系统:Windows-10-10.0.19044-SP0. python版本:3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)] 项目版本:v0.2.5 langchain版本:0.0.311. fastchat版本:0.2.29 当前使用的分词器:RecursiveCharacterTextSplitter 当前启动的LLM模型:['qwen-api'] @ cuda {'api_key': ‘', 'device': 'cuda', 'host': '127.0.0.1', 'infer_turbo': False, 'model_path': None, 'online_api': True, 'port': 21006, 'provider': 'QwenWorker', 'version': 'qwen-turbo', 'worker_class': <class 'server.model_workers.qwen.QwenWorker'>} 当前Embbedings模型: m3e-base @ cuda

附加信息 / Additional Information Package Version


accelerate 0.21.0
aiohttp 3.8.4
aiosignal 1.3.1
altair 5.1.1
antlr4-python3-runtime 4.9.3
anyio 3.7.1
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
arrow 1.2.3
asttokens 2.2.1
async-lru 2.0.2
async-timeout 4.0.2
attrs 23.1.0
Babel 2.12.1
backcall 0.2.0
backoff 2.2.1
backports.functools-lru-cache 1.6.4 bce-python-sdk 0.8.90 beautifulsoup4 4.12.2 bleach 6.0.0 blinker 1.6.2 blis 0.7.11 Bottleneck 1.3.5 cachetools 5.3.1 catalogue 2.0.9 certifi 2023.5.7 cffi 1.15.1 chardet 5.1.0 charset-normalizer 3.1.0 click 8.1.3 colorama 0.4.6 coloredlogs 15.0.1 colorlog 6.7.0 commonmark 0.9.1 confection 0.1.3 contourpy 1.0.7 controlnet-aux 0.0.6 cryptography 41.0.1 cycler 0.11.0 cymem 2.0.8 dashscope 1.11.0 dataclasses 0.6 dataclasses-json 0.5.7 debugpy 1.5.1 decorator 5.1.1 defusedxml 0.7.1 Deprecated 1.2.14 diffusers 0.18.2 dnspython 2.4.2 EbookLib 0.18 effdet 0.4.1 einops 0.6.1 email-validator 2.0.0.post2 emoji 2.8.0 entrypoints 0.4 environs 9.5.0 erniebot 0.3.1 et-xmlfile 1.1.0 exceptiongroup 1.1.1 executing 1.2.0 faiss-cpu 1.7.4 fastapi 0.103.2 fastjsonschema 2.17.1 filelock 3.12.0 filetype 1.2.0 Flask 2.2.5 flatbuffers 23.5.26 flit_core 3.9.0 fonttools 4.39.4 fqdn 1.5.1 frozenlist 1.3.3 fschat 0.2.29 fsspec 2023.5.0 future 0.18.3 gensim 4.3.1 gitdb 4.0.10 GitPython 3.1.37 google 3.0.0 greenlet 2.0.2 grpcio 1.47.5 grpcio-tools 1.47.5 h11 0.14.0 httpcore 0.16.3 httpx 0.24.1 huggingface-hub 0.17.2 humanfriendly 10.0 idna 3.4 imageio 2.31.1 importlib-metadata 6.6.0 importlib-resources 5.12.0 iniconfig 2.0.0 iopath 0.1.10 ipykernel 6.15.0 ipython 8.14.0 ipython-genutils 0.2.0 ipywidgets 8.0.6 isoduration 20.11.0 itsdangerous 2.1.2 jedi 0.18.2 Jinja2 3.1.2 joblib 1.2.0 json5 0.9.5 jsonpatch 1.33 jsonpointer 2.3 jsonschema 4.17.3 jupyter 1.0.0 jupyter_client 8.2.0 jupyter-console 6.6.3 jupyter-contrib-core 0.4.2 jupyter-contrib-nbextensions 0.7.0 jupyter_core 5.3.0 jupyter-events 0.6.3 jupyter-highlight-selected-word 0.2.0 jupyter-lsp 2.2.0 jupyter-nbextensions-configurator 0.6.3 jupyter_server 2.6.0 jupyter_server_terminals 0.4.4 jupyterlab 4.0.1 jupyterlab-pygments 0.2.2 jupyterlab_server 2.22.1 jupyterlab-widgets 3.0.7 kiwisolver 1.4.4 langchain 0.0.311 langcodes 3.3.0 langsmith 0.0.43 layoutparser 0.3.4 lazy_loader 0.3 lxml 4.9.2 Markdown 3.4.3 markdown2 2.4.10 MarkupSafe 2.1.1 marshmallow 3.19.0 marshmallow-enum 1.5.1 matplotlib 3.7.1 matplotlib-inline 0.1.6 mistune 2.0.5 mkl-service 2.4.0 mmh3 3.0.0 monotonic 1.6 mpmath 1.3.0 msg-parser 1.2.0 multidict 6.0.4 murmurhash 1.0.10 mypy-extensions 1.0.0 nbclassic 1.0.0 nbclient 0.8.0 nbconvert 7.4.0 nbformat 5.9.0 nest-asyncio 1.5.6 networkx 3.1 nh3 0.2.14 nltk 3.8.1 notebook 6.5.4 notebook_shim 0.2.3 numexpr 2.8.4 numpy 1.24.4 olefile 0.46 omegaconf 2.3.0 onnxruntime 1.15.1 openai 0.28.0 openapi-schema-pydantic 1.2.4 opencv-contrib-python 4.8.0.74 opencv-python 4.8.0.74 openpyxl 3.0.9 overrides 7.3.1 packaging 23.1 pandas 2.0.3 pandas-stubs 2.0.1.230501 pandocfilters 1.5.0 parso 0.8.3 pathlib 1.0.1 pathy 0.10.2 pdf2image 1.16.3 pdfminer.six 20221105 pdfplumber 0.9.0 peft 0.5.0 pgvector 0.2.2 pickleshare 0.7.5 Pillow 9.5.0 pip 23.0.1 pkgutil_resolve_name 1.3.10 platformdirs 3.5.1 plotly 5.14.1 pluggy 1.3.0 portalocker 2.7.0 preshed 3.0.9 prometheus-client 0.17.0 prompt-toolkit 3.0.38 protobuf 3.20.3 psutil 5.9.0 psycopg2 2.9.7 pure-eval 0.2.2 py 1.11.0 pyarrow 13.0.0 pybind11 2.10.4 pyclipper 1.3.0.post5 pycocotools 2.0.6 pycparser 2.21 pycryptodome 3.9.9 pydantic 1.10.12 pydeck 0.8.1b0 Pygments 2.15.1 PyJWT 2.8.0 pymilvus 2.1.3 PyMuPDF 1.22.5 pypandoc 1.11 pyparsing 3.0.9 pyre-extensions 0.0.29 pyreadline3 3.4.1 pyrsistent 0.18.0 PySocks 1.7.1 pytesseract 0.3.10 pytest 7.4.2 python-dateutil 2.8.2 python-decouple 3.8 python-docx 0.8.11 python-dotenv 1.0.0 python-iso639 2023.6.15 python-json-logger 2.0.7 python-magic 0.4.27 python-magic-bin 0.4.14 python-multipart 0.0.6 python-pptx 0.6.21 pytz 2020.5 PyWavelets 1.4.1 pywin32 305.1 pywinpty 2.0.10 PyYAML 6.0 pyzmq 25.0.2 qianfan 0.0.6 qtconsole 5.4.3 QtPy 2.3.1 rapidocr-onnxruntime 1.3.7 regex 2023.5.5 requests 2.31.0 retry 0.9.2 rfc3339-validator 0.1.4 rfc3986 1.5.0 rfc3986-validator 0.1.1 rich 13.0.1 safetensors 0.3.1 scikit-image 0.21.0 scikit-learn 1.2.2 scipy 1.10.1 Send2Trash 1.8.2 sentence-transformers 2.2.2 sentencepiece 0.1.99 setuptools 67.8.0 shapely 2.0.1 shortuuid 1.0.11 simplejson 3.19.1 six 1.16.0 sklearn 0.0.post5 smart-open 6.3.0 smmap 5.0.1 sniffio 1.3.0 soupsieve 2.3.2.post1 spacy 3.6.1 spacy-legacy 3.0.12 spacy-loggers 1.0.5 SQLAlchemy 2.0.19 srsly 2.4.8 stack-data 0.6.2 starlette 0.27.0 streamlit 1.27.0 streamlit-aggrid 0.3.4.post3 streamlit-antd-components 0.2.1 streamlit-chatbox 1.1.9 streamlit-option-menu 0.3.6 svgwrite 1.4.3 sympy 1.12 tabulate 0.9.0 tenacity 8.2.2 terminado 0.15.0 thinc 8.1.12 threadpoolctl 3.1.0 tifffile 2023.7.18 tiktoken 0.4.0 timm 0.9.2 tinycss2 1.2.1 tinyec 0.4.0 tokenizers 0.13.3 toml 0.10.2 tomli 2.0.1 toolz 0.12.0 torch 2.0.0+cu117 torchaudio 2.0.0+cu117 torchvision 0.15.1+cu117 tornado 6.2 tqdm 4.65.0 traitlets 5.9.0 transformers 4.33.2 transformers-stream-generator 0.0.4 typer 0.7.0 types-pytz 2023.3.0.0 typing_extensions 4.6.3 typing-inspect 0.8.0 typing-utils 0.1.0 tzdata 2023.3 tzlocal 5.0.1 ujson 5.4.0 unstructured 0.10.16 unstructured-inference 0.5.4 unstructured.pytesseract 0.3.12 uri-template 1.2.0 urllib3 2.0.2 uvicorn 0.23.2 validators 0.22.0 volcengine 1.0.108 Wand 0.6.11 wasabi 1.1.2 watchdog 3.0.0 wavedrom 2.0.3.post3 wcwidth 0.2.6 webcolors 1.13 webencodings 0.5.1 websocket-client 1.5.2 websockets 11.0.3 Werkzeug 3.0.0 wheel 0.38.4 widgetsnbextension 4.0.7 win-inet-pton 1.1.0 wrapt 1.14.1 xlrd 2.0.1 XlsxWriter 3.1.2 yarl 1.9.2 zhipuai 1.0.7 zipp 3.15.0

liunux4odoo commented 1 year ago

报一下你代码的commit号。或者更新代码再试一下

melodrama04 commented 1 year ago

遇到了同样的问题 请问解决了吗

pvtoan commented 1 year ago

Hi,

The reason is that Markdown() does not have "state".

To solve this problem, open "dialogue.py" under "webui_pages/dialogue/", and comment the part including "state ..."

For example, modify as follows: (Do it for all Markdown() in "dialogue.py" ) Markdown("...", in_expander=True, title="知识库匹配结果")]) #, state="complete")])

Hope this helps!

liunux4odoo commented 1 year ago

Hi,

The reason is that Markdown() does not have "state".

To solve this problem, open "dialogue.py" under "webui_pages/dialogue/", and comment the part including "state ..."

For example, modify as follows: (Do it for all Markdown() in "dialogue.py" ) Markdown("...", in_expander=True, title="知识库匹配结果")]) #, state="complete")])

Hope this helps!

streamlit-chatbox==1.1.9 do support state parameter in Markdonw, he may have wrong version installed.