Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对话时选prompt模板,弹窗总是不对应。 #3901

Closed
Hiyahh opened this issue Apr 26, 2024 · 4 comments
Closed

对话时选prompt模板,弹窗总是不对应。 #3901

Hiyahh opened this issue Apr 26, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Hiyahh
Copy link

Hiyahh commented Apr 26, 2024

问题描述 / Problem Description
用简洁明了的语言描述这个问题 / Describe the problem in a clear and concise manner.

复现问题的步骤 / Steps to Reproduce

  1. 执行 '...' / Run '...'
  2. 点击 '...' / Click '...'
  3. 滚动到 '...' / Scroll to '...'
  4. 问题出现 / Problem occurs

预期的结果 / Expected Result
描述应该出现的结果 / Describe the expected result.

实际结果 / Actual Result
描述实际发生的结果 / Describe the actual result.

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:(例如:v2.0.1 或 commit 123456) / langchain-ChatGLM version/commit number: (e.g., v2.0.1 or commit 123456)
  • 是否使用 Docker 部署(是/否):是 / Is Docker deployment used (yes/no): yes
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等):ChatGLM-6B / Model used (ChatGLM2-6B / Qwen-7B, etc.): ChatGLM2-6B
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):moka-ai/m3e-base / Embedding model used (moka-ai/m3e-base, etc.): moka-ai/m3e-base
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss
  • 操作系统及版本 / Operating system and version:
  • Python 版本 / Python version:
  • 其他相关环境信息 / Other relevant environment information:

附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.

@Hiyahh Hiyahh added the bug Something isn't working label Apr 26, 2024
Copy link

dosubot bot commented Apr 26, 2024

@Hiyahh 嗨!👋 我是Dosu,一个乐于助人的机器人,专门在这里帮助解决bug、回答问题,同时也能帮你更好地成为贡献者。我会在等待人类维护者的同时,尽我所能地为你提供帮助。现在,我将开始查看你的问题,并很快给你一个完整的回答。🔍😉

@Hiyahh
Copy link
Author

Hiyahh commented Apr 26, 2024

修改webui_pages/dialogue/dialogue.py文件的以下函数则会正确弹窗提示:
def prompt_change():
prompt_template_name = st.session_state.prompt_template_select # bug修复
text = f"已切换为 {prompt_template_name} 模板。"
st.toast(text)

Copy link

dosubot bot commented Apr 26, 2024

感谢您提供的解决方案!这看起来像是一个有效的修复方法。如果您在使用过程中遇到了弹窗不对应的问题,尝试按照这位用户的建议修改 webui_pages/dialogue/dialogue.py 文件中的 prompt_change 函数,可以解决问题。这个修复通过更新 prompt_template_name 变量来确保弹窗正确显示当前选择的模板名称。如果有其他用户遇到相同或相关问题,这个方法可能会对他们也有帮助。如果问题仍然存在或有其他疑问,欢迎继续提问。

Details

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.

To continue the conversation, mention @dosu.

@ilovesouthpark
Copy link

ilovesouthpark commented Apr 29, 2024

在满足调用empty的prompt以外的情况会准确提示和调用,empty的条件满足时无论选择哪个prompt实际调用的都是empty对应的prompt。我把58行这句改为了 '请你回答我的问题,并在回答开始前显示<p style="color: red;">从我们的知识库中没有找到答案。以下回复来自模型自身,仅供参考:

:\n' # 对回答的来源进行了红色提示。

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants