Suggestion: Explain that \ in prompt will cause ts to be escaped
例行检查
- [x] 我已确认目前没有类似 features
- [x] 我已确认我已升级到最新版本
- [x] 我已完整查看过项目 README,已确定现有版本无法满足需求
- [x] 我理解并愿意跟进此 features,协助测试和提供反馈
- [x] 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 features 可能会被无视或直接关闭
功能描述 最好在哪申明一下,prompt中包含\会使得ts转义,应该使用\\
应用场景 prompt中包含LaTex字符
相关示例
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Routine inspection
- [x] I have confirmed that there are currently no similar features
- [x] I have confirmed that I have upgraded to the latest version
- [x] I have fully reviewed the project README and determined that the existing version cannot meet the needs.
- [x] I understand and am willing to follow up on this feature, assist with testing and provide feedback
- [x] I understand and agree with the above content, and understand that project maintainers have limited energy. Features that do not follow the rules may be ignored or closed directly
Function description It’s best to state it somewhere. Containing \ in prompt will cause ts to be escaped.
Application Scenario prompt contains LaTex characters
Related Examples
体现在什么地方?有例子么
体现在什么地方?有例子么
体现在用包含LaTex的内容去产生QA时,数据集中的\nu \nabla等就会转义。我不知道怎么排查了。似乎光prompt用//没用,因为这只是个引导。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
 is reflected in what place? Are there any examples?
This is reflected in the fact that when content containing LaTex is used to generate QA, \n\ and the like in the data set will be escaped.
红色处的换行就是\nu中的\n被换行了
实在有点摸不着头脑,一会好一会坏的。。。之前关于问题的表述应该是有问题的。我看看再继续反馈吧。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I'm really confused, sometimes it's good and sometimes it's bad. . . The previous statement of the problem should be problematic. I'll take a look and give you feedback.
似乎与问答拆分有关:
原始文件:
test.txt
直接拆分(没有问题):
问答拆分(有问题,所有\n都变成了换行):
猜测是因为这一行,准备测试一下。 https://github.com/zenyanbo/FastGPT/blob/253c143a5206b3196f53613f6314af4929f8835f/projects/app/src/service/events/generateQA.ts#L215
注释了似乎就好了,不知道会不会有啥副作用。
注释了希望就好了,不知道会不会有啥后果。
噢ye,确实是有这个问题。这个之前似乎是为了解决csv里换行符问题,加了这个判断。我没考虑到有实际文本会包含 “\n” 的情况,,我思考下如何解决。
我的办法是修改了正则表达式:/\n\W/g 另外,对话页面的latex也有问题,我也是用.replace(/\n\W/g, '\n ')解决的
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
My solution is to modify the regular expression: /\n\W/g In addition, there is also a problem with latex on the dialogue page. I also used .replace(/\n\W/g, '\n ') to solve it.
体现在什么地方?有例子么