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.84k stars 5.55k forks source link

选择知识库问答是当对话的次数过多后,滚动条每次都会从最上面划下来 #3705

Closed goldmei closed 6 months ago

goldmei commented 6 months ago

选择知识库问答是当对话的次数过多后,滚动条每次都会从最上面划下来,而不是从之前的位置划到最下面

dosubot[bot] commented 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.

goldmei commented 6 months ago

在出结果之前滚动条直接停留了最上面了,结果出来后就从最上面划到了最下面

dosubot[bot] commented 6 months ago

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:

  1. 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.

  2. 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.

  3. 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.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
akkkkkkkkki commented 6 months ago

我也遇到了这个问题,环境如下: ==============================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

zRzRzRzRzRzRzR commented 6 months ago

streamlit渲染的问题,我们之后考虑改进一下