Closed goldmei closed 6 months ago
Hey there, @goldmei! Nice to see you back with us. 😊 I remember our last chat! I'm diving into your scrollbar conundrum right now and will get back to you with a solution shortly.
在出结果之前滚动条直接停留了最上面了,结果出来后就从最上面划到了最下面
To tackle the issue where the scrollbar jumps to the top before settling at the bottom after a new message is displayed in your chat interface, consider the following approach:
Adjust the ChatBox Implementation: If you have control over the ChatBox
class, enhance the output_messages()
method to ensure the chat container scrolls to the bottom after new messages are rendered. This typically involves manipulating the scroll position of the chat container element directly.
Streamlit Custom Components: If ChatBox
is a custom Streamlit component, you might need to adjust its frontend code to include JavaScript for managing the scroll position effectively.
Streamlit Workaround: As a temporary solution, using Streamlit's st.empty()
as a placeholder to maintain a reference to the message display area might help. Updating this placeholder with new messages could potentially keep the scroll position more stable.
Without specific details on the ChatBox
class or the chat_box.output_messages()
method, these suggestions are based on common practices for handling scroll behavior in web applications. If ChatBox
is part of a library with scroll management features, consulting its documentation might reveal more direct solutions.
我也遇到了这个问题,环境如下: ==============================Langchain-Chatchat Configuration============================== 操作系统:Linux-5.4.0-150-generic-x86_64-with-glibc2.10. python版本:3.8.1 (default, Jan 8 2020, 22:29:32) [GCC 7.3.0] 项目版本:v0.2.10 langchain版本:0.0.354. fastchat版本:0.2.35
当前使用的分词器:ChineseRecursiveTextSplitter 当前启动的LLM模型:['zhipu-api'] @ cuda {'api_key': '', 'device': 'auto', 'host': '0.0.0.0', 'infer_turbo': False, 'online_api': True, 'port': 21001, 'provider': 'ChatGLMWorker', 'version': 'glm-4', 'worker_class': <class 'server.model_workers.zhipu.ChatGLMWorker'>} 当前Embbedings模型: text2vec-base-chinese @ cuda
streamlit渲染的问题,我们之后考虑改进一下
选择知识库问答是当对话的次数过多后,滚动条每次都会从最上面划下来,而不是从之前的位置划到最下面