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

回复是英文的,怎么改成中文的? #32

Open
alexhmyang opened this issue May 16, 2023 · 4 comments
Open

回复是英文的,怎么改成中文的? #32

alexhmyang opened this issue May 16, 2023 · 4 comments

Comments

@alexhmyang
Copy link

Prompt里的原因? 请问怎么改

@daodao97
Copy link
Owner

目前来了这个问题没办法根本性的避免, 一般情况下回复中使用的语言会跟提问的语言相同, 但有时也会回复时只有英文

可以在提示添加限定, 使用中文回答, 也可以修改项目的prompt https://github.com/daodao97/chatdoc/blob/master/server/doc_util.py#L23 添加中文回复的提示

@alexhmyang
Copy link
Author

alexhmyang commented May 17, 2023

目前来了这个问题没办法根本性的避免, 一般情况下回复中使用的语言会跟提问的语言相同, 但有时也会回复时只有英文

可以在提示添加限定, 使用中文回答, 也可以修改项目的prompt https://github.com/daodao97/chatdoc/blob/master/server/doc_util.py#L23 添加中文回复的提示

我改过 这个,也不能完全避免英文回复。需要每次在提问中添加 使用中文回答 。 很奇怪的是,为什么 chat对话是中文,但是 pdf解答就是 英文呢

您这套代码 他原理跟 chatgpt对话有什么不同,是跟 pdf本身编码有关么? 还是跟什么有关

@daodao97
Copy link
Owner

并没有什么不同,找到答案了可以分享下

@ForcewithMe66
Copy link

@daodao97 , 在prompt的最后,用中文加一句“请用中文回答问题”可解。尝试过用英文改Prompt,都不行。但是用中文改prompt,测了10几个问题都是返回的中文。

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

No branches or pull requests

3 participants