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

Fix an unusual issue that occurs when using OpenAIChat for llm_math #1410

Merged
merged 1 commit into from
Mar 4, 2023
Merged

Conversation

pengqu123
Copy link
Contributor

@pengqu123 pengqu123 commented Mar 3, 2023

Fix an issue that occurs when using OpenAIChat for llm_math, refer to the code style of the "Final Answer:" in Mrkl。 the reason is I found a issue when I try OpenAIChat for llm_math, when I try the question in Chinese, the model generate the format like "\n\nQuestion: What is the square of 29?\nAnswer: 841", it translate the question first , then answer. below is my snapshot:
snapshot

… the code style of the "Final Answer:" in Mrkl
@pengqu123
Copy link
Contributor Author

pengqu123 commented Mar 3, 2023

Sorry, I need to add one more point of clarification. My prompt includes a "fifth root" question, and without it, OpenAIChat works fine. Of course, whether or not the prompt is included, OpenAI always works fine. I think this will help you determine whether or not this PR needs to be merged. From my personal perspective and my experience of debugging non-English languages, I still recommend this PR.

Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@hwchase17 hwchase17 merged commit 68ce68f into langchain-ai:master Mar 4, 2023
zachschillaci27 pushed a commit to zachschillaci27/langchain that referenced this pull request Mar 8, 2023
…angchain-ai#1410)

Fix an issue that occurs when using OpenAIChat for llm_math, refer to
the code style of the "Final Answer:" in Mrkl。 the reason is I found a
issue when I try OpenAIChat for llm_math, when I try the question in
Chinese, the model generate the format like "\n\nQuestion: What is the
square of 29?\nAnswer: 841", it translate the question first , then
answer. below is my snapshot:
<img width="945" alt="snapshot"
src="https://user-images.githubusercontent.com/82029664/222642193-10ecca77-db7b-4759-bc46-32a8f8ddc48f.png">
@1973sir
Copy link

1973sir commented Mar 16, 2023

hello,老哥,我在调用Memory相关功能的时候也发现它会翻译中文为英文,不知道有没有什么好办法?
image
如果是用Conversation Knowledge Graph Memory的话就根本不返回东西

@pengqu123
Copy link
Contributor Author

hello,老哥,我在调用Memory相关功能的时候也发现它会翻译中文为英文,不知道有没有什么好办法? image 如果是用Conversation Knowledge Graph Memory的话就根本不返回东西

@1973sir 我对memory源码不算熟啊。首先memory应该不会翻译。 但是你那个会自动summary,我简单看了一眼源码,llm跑了一波生成summary的功能,这个summary的prompt都是英文写的。你只是要memory的话,用 ConversationBufferMemory试试?而且你要是纯闲聊场景,直接用conversational agent看看?

@1973sir
Copy link

1973sir commented Mar 17, 2023

hello,老哥,我在调用Memory相关功能的时候也发现它会翻译中文为英文,不知道有没有什么好办法? image 如果是用Conversation Knowledge Graph Memory的话就根本不返回东西

@1973sir 我对memory源码不算熟啊。首先memory应该不会翻译。 但是你那个会自动summary,我简单看了一眼源码,llm跑了一波生成summary的功能,这个summary的prompt都是英文写的。你只是要memory的话,用 ConversationBufferMemory试试?而且你要是纯闲聊场景,直接用conversational agent看看?

我是在开发一个AI陪伴机器人,用memory主要是为了存储长期记忆,用记忆图谱是为了存储对话过程中用户提供的有关自己的个性化信息。我先看看你说的conversational agent。我用的gpt-3.5-turbo模型。你在搞啥项目呀?

@1973sir
Copy link

1973sir commented Mar 17, 2023

conversational agent貌似比较适合复现类似网页版chatgpt的应用,不太适合做长期的AI陪伴机器人。ConversationBufferMemory的话只适合当前session,没法保存长期记忆。实在不行也许只能找个支持中文的summary/embedding的三方库,自己搞记忆检索/知识库存储/提取相关的组件了。

@1973sir
Copy link

1973sir commented Mar 17, 2023

刚又看了下文档,他们新增了Chat Vector DB那些,不过我估计不支持中文。

@pengqu123
Copy link
Contributor Author

@1973sir 这儿不适合讨论这些。你有其他联系方式吗?我们下来沟通

@1973sir
Copy link

1973sir commented Mar 17, 2023

@1973sir 这儿不适合讨论这些。你有其他联系方式吗?我们下来沟通

方便的话加我微信吧 pinball1973

@bilok1121
Copy link

@1973sir 这儿不适合讨论这些。你有其他联系方式吗?我们下来沟通

方便的话加我微信吧 pinball1973

也遇到了类似问题,想讨论

@1973sir
Copy link

1973sir commented Apr 20, 2023

@1973sir 这儿不适合讨论这些。你有其他联系方式吗?我们下来沟通

方便的话加我微信吧 pinball1973

也遇到了类似问题,想讨论

可以加微信聊哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants