Langchain-Chatchat
Langchain-Chatchat copied to clipboard
重写 streamlit UI
- 用
streamlit-chatbox重写了webui_st.py,隐藏对话框细节,使webui的逻辑结构更清楚。 - 添加
no_remote_model,use_ptuning_v2,use_lora等参数,使得重新加载模型按钮正常工作,与原webui功能保持最大兼容。 - 对
local_doc_qa和shared.loaderCheckPoint进行处理,防止模型重复加载造成OOM。
现在多个session可以共同使用,但最好保持模型参数一致,否则还是容易导致模型冲突或者重复加载。
您好,感谢您对本项目做出的贡献,请问可否将pr发起至dev分支,方便与其他功能一起在下一版本中发布。
您好,感谢您对本项目做出的贡献,请问可否将pr发起至dev分支,方便与其他功能一起在下一版本中发布。
抱歉,对pr的流程还不是太熟悉
您好,感谢您对本项目做出的贡献,请问可否将pr发起至dev分支,方便与其他功能一起在下一版本中发布。
抱歉,对pr的流程还不是太熟悉
没事没事 主要是因为dev分支中部分变更对webui产生了影响,所以webui_st也进行了相应的调整比如import时的llm base类中的BaseAnswer等
streamlit 打不开请问咋解呢,而且peotouf必须是3.20版本的
您好,目前streamlit已经推出了官方的chat组件,是否有兴趣一起用官方组件完成基于streamlit的webui demo呢?
您好,目前streamlit已经推出了官方的chat组件,是否有兴趣一起用官方组件完成基于streamlit的webui demo呢?
我用最新的streamlit message elements重写了Demo,但是因依赖冲突无法运行: streamlit从1.24.0版本才有st.chat_message,但这个版本要求protobuf>=4,而icetk要求protobuf<3.19。我试了3.18和4.23两个版本,总是报错。
目前chatglm应该已经不依赖于icetk了,晚上我再测试一下,应该可以解决这个问题。或者就是运行前用另一环境。
liunux4odoo @.***>于2023年7月3日 周一10:23写道:
您好,目前streamlit已经推出了官方的chat组件,是否有兴趣一起用官方组件完成基于streamlit的webui demo呢?
我用最新的streamlit message elements重写了Demo,但是因依赖冲突无法运行:
streamlit从1.24.0版本才有st.chat_message,但这个版本要求protobuf>=4,而icetk要求protobuf<3.19。我试了3.18和4.23两个版本,总是报错。
— Reply to this email directly, view it on GitHub https://github.com/imClumsyPanda/langchain-ChatGLM/pull/500#issuecomment-1617124852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EVXADGGOT3ITCQPHXLXOIUJDANCNFSM6AAAAAAYT2LRTQ . You are receiving this because you commented.Message ID: @.***>
streamlit 打不开请问咋解呢,而且peotouf必须是3.20版本的
你streamlit版本是多少?streamlit从1.23开始使用高版本protobuf,与本项目中要求的protobuf版本冲突。
目前chatglm应该已经不依赖于icetk了,晚上我再测试一下,应该可以解决这个问题。或者就是运行前用另一环境。 liunux4odoo @.>于2023年7月3日 周一10:23写道: … 您好,目前streamlit已经推出了官方的chat组件,是否有兴趣一起用官方组件完成基于streamlit的webui demo呢? 我用最新的streamlit message elements重写了Demo,但是因依赖冲突无法运行: streamlit从1.24.0版本才有st.chat_message,但这个版本要求protobuf>=4,而icetk要求protobuf<3.19。我试了3.18和4.23两个版本,总是报错。 — Reply to this email directly, view it on GitHub <#500 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EVXADGGOT3ITCQPHXLXOIUJDANCNFSM6AAAAAAYT2LRTQ . You are receiving this because you commented.Message ID: @.>
我是从依赖中第一个找到icetk的,后来查到版本冲突的包一共有3个:
icetk 0.0.7 requires protobuf<3.19, but you have protobuf 4.23.3 which is incompatible.
onnx 1.12.0 requires protobuf<=3.20.1,>=3.12.2, but you have protobuf 4.23.3 which is incompatible.
paddlepaddle 2.4.2 requires protobuf<=3.20.0,>=3.1.0, but you have protobuf 4.23.3 which is incompatible.
刚才用protobuf==4.23.3测试了一下,icetk和onnx暂时没有报错,paddle报错如下:
TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are: 1. Downgrade the protobuf package to 3.20.x or lower. 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower). More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
traceback:
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script
exec(code, module.__dict__)
File "D:\chatglm\langchain-ChatGLM\webui_st.py", line 9, in <module>
from chains.local_doc_qa import LocalDocQA
File "D:\chatglm\langchain-ChatGLM\.\chains\local_doc_qa.py", line 11, in <module>
from loader import UnstructuredPaddleImageLoader, UnstructuredPaddlePDFLoader
File "D:\chatglm\langchain-ChatGLM\.\loader\__init__.py", line 1, in <module>
from .image_loader import UnstructuredPaddleImageLoader
File "D:\chatglm\langchain-ChatGLM\.\loader\image_loader.py", line 5, in <module>
from paddleocr import PaddleOCR
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddleocr\__init__.py", line 14, in <module>
from .paddleocr import *
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddleocr\paddleocr.py", line 21, in <module>
import paddle
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddle\__init__.py", line 25, in <module>
from .framework import monkey_patch_variable
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddle\framework\__init__.py", line 17, in <module>
from . import random # noqa: F401
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddle\framework\random.py", line 16, in <module>
import paddle.fluid as fluid
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddle\fluid\__init__.py", line 36, in <module>
from . import framework
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddle\fluid\framework.py", line 35, in <module>
from .proto import framework_pb2
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\paddle\fluid\proto\framework_pb2.py", line 33, in <module>
_descriptor.EnumValueDescriptor(
File "D:\chatglm\app\anaconda3\envs\glm\lib\site-packages\google\protobuf\descriptor.py", line 796, in __new__
_message.Message._CheckCalledFromGeneratedFile()
- 用
streamlit-chatbox重写了webui_st.py,隐藏对话框细节,使webui的逻辑结构更清楚。- 添加
no_remote_model,use_ptuning_v2,use_lora等参数,使得重新加载模型按钮正常工作,与原webui功能保持最大兼容。- 对
local_doc_qa和shared.loaderCheckPoint进行处理,防止模型重复加载造成OOM。现在多个session可以共同使用,但最好保持模型参数一致,否则还是容易导致模型冲突或者重复加载。
很好的PR。 好像提交不全,没看到 AnswerResultStream 的定义有提交。 建议在最新的版本上,重新迁移一下stream的修改,再提交pr,方便测试修改。
cannot import name 'AnswerResultStream' from 'models.base'
- 用
streamlit-chatbox重写了webui_st.py,隐藏对话框细节,使webui的逻辑结构更清楚。- 添加
no_remote_model,use_ptuning_v2,use_lora等参数,使得重新加载模型按钮正常工作,与原webui功能保持最大兼容。- 对
local_doc_qa和shared.loaderCheckPoint进行处理,防止模型重复加载造成OOM。现在多个session可以共同使用,但最好保持模型参数一致,否则还是容易导致模型冲突或者重复加载。
很好的PR。 好像提交不全,没看到 AnswerResultStream 的定义有提交。 建议在最新的版本上,重新迁移一下stream的修改,再提交pr,方便测试修改。
cannot import name 'AnswerResultStream' from 'models.base'
现在看来,由于protobuf版本冲突,streamlit官方最新的chat_message暂时用不上。 暂时还是用非官方的streamlit_chatbox,至少目前功能上是足够用了。 我会尽快重新提交一个PR。
streamlit官方最新的chat_message好像不好用,参数太少,可定制能力差。
streamlit官方最新的chat_message好像不好用,参数太少,可定制能力差。
可以试一下streamlit-chatbox==0.2.4。相比官方组件,更简洁一些,还支持输出图片/视频/音频。
官方组件虽然留了较大的扩展性,但需要自己做wrapper去实现。官网上给的例子也只是简单渲染文本