Hk-Gosuto / ChatGPT-Next-Web-LangChain

一键拥有你自己的 ChatGPT 网页服务。 One-Click to deploy your own ChatGPT web UI.(基于 langchain 实现的插件版本 Plugin version implemented based on langchain)
https://n3xt.chat
MIT License
1.08k stars 398 forks source link

[Bug] pdf插件总结pdf总结的跟我发给他的完全不相关,发渐冻症的pdf,返回深度学习卷积的总结 #186

Closed zpng closed 4 months ago

zpng commented 5 months ago

为了提高交流效率,我们设立了官方 QQ 群和 QQ 频道,如果你在使用或者搭建过程中遇到了任何问题,请先第一时间加群或者频道咨询解决,除非是可以稳定复现的 Bug 或者较为有创意的功能建议,否则请不要随意往 Issue 区发送低质无意义帖子。

点击加入官方群聊

反馈须知

⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭,如果没有提供下方的信息,我们无法定位你的问题。

请在下方中括号内输入 x 来表示你已经知晓相关内容。

描述问题 我让pdf插件总结一个渐冻症相关的论文,但是却返回出来了卷积神经网络的返回,很奇怪。

问题: 帮我总结下该pdf https://arxiv.org/pdf/1401.0697v1.pdf 返回: image 可是该pdf的内容为: image ,很奇怪,试了很多次都是这个返回,不理解这个是哪里的bug,辛苦大佬帮忙看下

一些必要的信息

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] The pdf plug-in summarizes the pdf, but the summary is completely irrelevant to what I sent him, the ALS pdf, returns the summary of deep learning convolution

In order to improve communication efficiency, we have set up an official QQ group and QQ channel. If you encounter any problems during use or construction, please join the group or channel for consultation as soon as possible, unless it is a bug that can be stably reproduced or More creative feature suggestions, otherwise please do not send low-quality and meaningless posts to the Issue area.

Click to join the official group chat

Feedback Instructions

⚠️ NOTE: Any post that does not follow this template will be immediately closed and we will not be able to locate your issue without providing the information below.

Please enter x in the square brackets below to indicate that you already know the relevant content.

Describe the problem I asked the pdf plug-in to summarize a paper related to ALS, but it returned the convolutional neural network, which is very strange.

question: Help me summarize this pdf https://arxiv.org/pdf/1401.0697v1.pdf return: image But the content of the pdf is: image , it’s very strange. I tried it many times and it always returns the same result. I don’t understand where the bug is. Could you please help me check it out?

Some necessary information

Hk-Gosuto commented 5 months ago

未能复现该问题 image

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Unable to reproduce the problem image

zpng commented 5 months ago

未能复现该问题 image

那好奇怪啊,我是用这个插件的时候有时候用其他pdf能正确总结,有时候就跟这个issue一样不行,重试多少遍结果都一样,大佬能猜测出来啥原因吗,有可能跟配置和部署有关系吗

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Failed to reproduce the problem![image](https://private-user-images.githubusercontent.com/14031260/303892511-1ff42827-2438-49b1-bb1f-b24679bc3f39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..g_ -JtLA3iBLa_IdcuMJM0lWnjleN9HqgehATaFwH8bI )

That's so strange. When I use this plug-in, sometimes I can summarize it correctly with other PDFs, but sometimes it doesn't work just like this issue. The result is the same no matter how many times I try again. Can anyone guess the reason? It may be the same as this issue. Is there any relationship between configuration and deployment?

zpng commented 5 months ago

我刚又试了一遍还是一样的结果,还是会返回卷积神经网络相关内容 image

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


I just tried it again and still got the same result. It still returns convolutional neural network related content. image

Hk-Gosuto commented 5 months ago

镜像是否为最新的?换其他pdf链接也是这样?

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Is the image up to date? Is this the same for other pdf links?

zpng commented 5 months ago

我是拉取的最新代码部署的,有的pdf链接可以,有的不行,很奇怪

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Hk-Gosuto @.> 发送时间: 2024年2月11日 10:16 收件人: Hk-Gosuto/ChatGPT-Next-Web-LangChain @.> 抄送: zpng @.>, Author @.> 主题: Re: [Hk-Gosuto/ChatGPT-Next-Web-LangChain] [Bug] pdf插件总结pdf总结的跟我发给他的完全不相关,发渐冻症的pdf,返回深度学习卷积的总结 (Issue #186)

镜像是否为最新的?换其他pdf链接也是这样?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zpng commented 5 months ago

这个pdf总结的同样有问题,明明讲的是自己的投资故事,总结成了股票交易规则,完全不对

帮我总结下该pdf的内容: https://edu.sse.com.cn/theme/investors/share/c/4726971.pdf image 这个pdf总结的同样有问题,明明讲的是自己的投资故事,总结成了股票交易规则,完全不对 image

@Hk-Gosuto

Hk-Gosuto commented 5 months ago

这个pdf总结的同样有问题,明明讲的是自己的投资故事,总结成了股票交易规则,完全不对

帮我总结下该pdf的内容: https://edu.sse.com.cn/theme/investors/share/c/4726971.pdf image 这个pdf总结的同样有问题,明明讲的是自己的投资故事,总结成了股票交易规则,完全不对 image

@Hk-Gosuto

总结也不是全文总结,是基于 langchian 的 TextSplitter 分割文本后的前4行,现有模型的上下文长度没办法对 pdf 进行全部文本总结,跟完整文档有出入也并不奇怪。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


This PDF summary also has problems. It is obviously about my own investment story, and it is summarized into stock trading rules, which is completely wrong.

Help me summarize the content of this pdf: https://edu.sse.com.cn/theme/investors/share/c/4726971.pdf ![image](https://private-user-images.githubusercontent. com/8509438/304114441-207534cc-343a-4a46-869c-fcc1ee2610c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..mqAjIKDNf_RUlr-sNH2Rebn0nTgGen9zwJS1G kAdyQk) This PDF summary also has problems. It is obviously about my own investment story, and it is summarized into stock trading rules. , completely wrong![image](https://private-user-images.githubusercontent.com/8509438/304114516-a156c185-521f-4c6d-be71-70c2e09cee6e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..04mXPz xnEuuA2MJIwTodgIYNrx8uBad1geoQ08_N7Ig)

@Hk-Gosuto

The summary is not a full-text summary, but is based on the first 4 lines after the text is divided by langchian's TextSplitter. The context length of the existing model cannot summarize the entire text of the pdf, so it is not surprising that it is different from the complete document.

Hk-Gosuto commented 5 months ago

比如你上面的 pdf 的完整 prompt就是:

Text:我的投资故事 
1

我的投资故事分享

本人是国泰君安的一名普通
小散,2008年7月份入市,到现
在快满八个年头了,经历了2008
年低点、2009年小牛市以及后来
长达五年的猴市,也感受了去年
的火与冰。8年的炒股经历让我
从无知到知道无知,从无头苍蝇
到有的放矢。除了股市的盈亏,
还收获了更为宝贵的东西,那就
是认识了不少朋友,有聊得来的,
有吹牛的,有故弄高深的,也有
很多真诚的,热心的,有真才实
学的人。

这八年里,通过失败经验和
个人学习,有了些许经验,给大
家分享一下:
思考一:炒股的本质、人生
的本质
    股市如人生,人生如股市,
总有高低不平,总有潮涨潮落。
当初自己进股市炒股,为的是什
么,不就是赚点钱改善下生活质
量。其实现在生活还过得去,有
房住,有衣穿,有家庭,无风吹
日晒之忧,无下顿温饱之虑。何
以入市以来如此浮躁呢,猛然间
醒悟,缘于人性的不足-贪婪,因
为贪婪,让自己失去了理智,迷
失了方向,以致丢失生活的本真。
相信有不少初炒股的人有过和我
一样的经历,因为炒股,影响了
工作,冷落了家人,孩子学校有
活动,自己正在看指标,一句话, 我的投资故事
2

没空,一个亲近孩子的机会就此
消失;因为股票大跌,心情烦躁,
和老婆闹气的事也没有少。忽然
间自己体内有个声音,如晴天霹
雳让自己犹如冬天被冷水淋湿般
惊颤,“你在干什么!不要迷失
在歧途!”确实是误入歧途啊。
如此炒股,如此折腾,离原来的
意图越来越远啦!美好的生活是
人生主旋律,炒股是人生的小插
曲,小插曲须服从主旋律。于是,
和老婆上街看下衣服,陪孩子到
学校参加元旦游园活动,陪老父
亲回味下红歌,其乐融融,不亦
乐乎!哈,这才是生活的本真。
炒股应服务于生活,尚若因它影
响了生活质量,当让其消失。

思考二:小散作风,小散心
态
    道听途说,跟风操作,人云
亦云,高买低抛,无疑是自己经
常做的事。没有自己的理解,没
有自己的见地,没有用心理解股
票的道理。股票下跌时,惶惶不
可终日,割,它马上反弹;不割,
它一路狂跌丝毫不见抬头踪迹。
股票上升时,也混身不自在,不
如如何是好,卖,它却一路飙升;
不卖,它却应声下跌,确实让我
等小散不知如何是好。这一切皆
缘于自己的无知,没有了解其中
道理,没有理解其中趋势,分不
清主力是否在出货,是否在调整,
是否在拉升。盲目追高,盲目抄
底,也是我等小散资金损失的主
要原因。不知者无畏,不知道高
处不胜寒,低处不言底。只有做
到有把握,才可一战成功,尚若
相去甚远,应立即空仓反思,保
得本金在,不怕没柴烧。今后,
唯有用心参悟股票之道,慢慢把
握其趋势,慢慢去除小散作风,
小散心态,方能适应节奏,获得我的投资故事
3

收益。

思考三:投资与生活之道
    炒股,需要淡定,需要驽驾
之从容心。有了解,有把握,有
钱途。炒股是投资的一种,是放
鸡蛋的其中的一个篮子。得之我
幸,失之亦无伤大雅。股市有同
人生,人生同股市,无非涨跌,
得势时,春风得意,加薪进爵;
失势时,垂头丧气,前途暗淡。
得失涨跌之间,会有平衡之点,
是起还是再落,看你自己气势,
看你自己积聚的能量。投资与生
活,简而述之:理性投资,美好
生活。

“宠辱不惊,闲看庭前花开花落,
去留无意,漫随天外云卷云舒。”

附带:个人炒股笔迹

 我的投资故事
4

                                         国泰君安证券湖南常德人民路证券营业部
                                       投资者  老谭

I need a summary from the above text.
Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


For example, the complete prompt for your pdf above is:


Text:My investment story
1

Sharing my investment story

I am an ordinary employee of Guotai Junan Xiaosan, entered the market in July 2008, till now It’s almost eight years and I have experienced 2008 Yearly lows, the 2009 bull market and beyond The five-year-old Monkey Market also felt the same as last year. of fire and ice. 8 years of experience in stock trading have taught me From ignorance to knowing ignorance, from being a headless fly Get to the point. In addition to the profit and loss of the stock market, I also gained something more valuable, that is I have made a lot of friends and can talk to each other. Some brag, some pretend to be sophisticated, and some Many sincere, enthusiastic and talented people People who learn.

In these eight years, through failure experience and Personal study, with some experience, I can give it to others Share it with us: Thought 1: The essence of stock trading and life the essence of The stock market is like life, life is like the stock market, There are always ups and downs, there are always ebbs and flows. Why did I enter the stock market to trade in the first place? Well, isn’t it just to make some money and improve the quality of life? quantity. In fact, life is pretty good now, with A house to live in, clothes to wear, a family, no wind You don’t have to worry about being exposed to the sun, but you don’t have to worry about food and clothing. what Having been so impetuous since entering the market, suddenly Awakening, due to the shortcomings of human nature - greed, due to Because of greed, I lost my mind and became obsessed with Losing direction and losing the true nature of life. I believe there are many people who are new to stock trading and I have The same experience, because of stock trading, affected Work has left my family in the cold, and my children have problems in school. Activity, I am looking at the indicators, in one sentence, my investment story 2

No time, this is the chance to get close to my children disappeared; because the stock price plummeted, I felt irritable, There are also many incidents of getting angry with my wife. suddenly Suddenly there was a voice inside me, like a thunderbolt from the blue sky Let yourself be soaked like cold water in winter Trembling, "What are you doing! Don't get lost On the wrong track! "It's indeed a misguided approach. Such stock trading, such toss and turns, are far from the original The intention is getting farther and farther! a good life is The main theme of life, stock trading is a sideshow in life Songs and vignettes must obey the main melody. then, I went to the street with my wife to look at clothes and accompanied my children. The school participated in the New Year's Day garden party to accompany my father I reminisce about the red song, it's so joyful and wonderful Happy! Ha, this is the true nature of life. Stock trading should serve life, not because it affects If it affects the quality of life, let it disappear.

Thought 2: Small style, small mind state Hearsay, follow the trend, people say As the saying goes, buying high and selling low is undoubtedly the result of my own experience. Something that is often done. I don’t have my own understanding, no Have your own opinions and don’t understand stocks carefully The principle of voting. When stocks fall, panic But all day long, if you cut it, it will rebound immediately; if you don’t cut it, it will rebound immediately. It plummeted all the way and showed no sign of rising. When the stock price rises, I feel uncomfortable. What to do, sell it, but it keeps soaring; Not selling, but it fell in response, which really made me Waiting for Xiaosan not knowing what to do. All this is Due to my own ignorance, I did not understand it Reason, if you don’t understand the trend, you can’t tell the difference. Check whether the main force is shipping and adjusting. Is it pulling up? Blindly chasing high, blindly copying At the end of the day, it is also the main reason for the losses of small retail funds such as mine. Want a reason. Those who don’t know are fearless, those who don’t know the heights It's always cold when you're in a cold place, and you don't know the bottom of things when you're in a low place. only do Only when you are confident can you succeed in a battle. It’s a far cry from that. You should immediately reflect on your short position and keep it safe. As long as the capital is there, you don't have to worry about running out of firewood. from now on, Only by carefully understanding the ways of stocks, and slowly grasping the Grasp the trend and slowly eliminate the scattered style. Only with a relaxed mentality can you adapt to the rhythm and get my investment story 3

income.

Thought Three: Investment and Lifestyle Stock trading requires calmness and drive The calm heart. Understand, have confidence, have Money path. Stock trading is a type of investment. Eggs in one of the baskets. I got it Fortunately, it doesn't hurt to lose it. The stock market has the same Life, like the stock market, is nothing more than ups and downs. When you are in power, you are proud of yourself, get a salary increase and become a noble; When you lose power, you feel downcast and your future is bleak. There will be a point of balance between gains and losses, ups and downs, Whether it rises or falls again depends on your own momentum. Look at the energy you have accumulated. Investment and production Life, in short: rational investment, beautiful Life.

"Don't be surprised by favor or disgrace, just watch the flowers blooming and falling in front of the court. There is no intention to stay or go, just follow the clouds rolling and relaxing in the sky. "

Attached: personal stock trading handwriting

My investment story 4

                                     Guotai Junan Securities Securities Sales Department, Renmin Road, Changde, Hunan
                                   Investor Lao Tan

I need a summary from the above text.

Hk-Gosuto commented 5 months ago

我这里使用的模型是 3.5 turbo,总结的内容倒是没有太大出入: image

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


The model I am using here is the 3.5 turbo, and the summary is not much different: image

zpng commented 5 months ago

你的看起来还是蛮正常的,为啥我的初入这么大呢,你仔细看下我的那个gpt的回答非常离谱

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Yours looks pretty normal. Why is mine so big for the first time? If you take a closer look at my gpt, the answer is very outrageous.

zpng commented 5 months ago

image

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


image

zpng commented 5 months ago

@Hk-Gosuto 再给大佬一个输入,当我把其它插件都关闭,只打开pdf插件的时候,报下面的问题,所以看起来是因为pdf插件没有生效?但是引入了另外一个问题,这个为啥没生效呢?如果没生效之前的回答是啥回答呢,我在本地和zeabur线上部署测试都不行。ps 我是刚拉取的最新代码测的 image

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


@Hk-Gosuto Give me another input. When I close all other plug-ins and only open the pdf plug-in, the following problem is reported. So it seems that the pdf plug-in is not effective? But another question is introduced, why doesn't this take effect? What is the answer before it takes effect? ​​I cannot deploy the test locally or on zeabur online. image

Hk-Gosuto commented 5 months ago

@Hk-Gosuto 再给大佬一个输入,当我把其它插件都关闭,只打开pdf插件的时候,报下面的问题,所以看起来是因为pdf插件没有生效?但是引入了另外一个问题,这个为啥没生效呢?如果没生效之前的回答是啥回答呢,我在本地和zeabur线上部署测试都不行。ps 我是刚拉取的最新代码测的 image

这种可能是网络问题导致的,跟开关几个插件没什么关系。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


@Hk-Gosuto Give me another input. When I close all other plug-ins and only open the pdf plug-in, the following problem is reported. So it seems that the pdf plug-in is not effective? But another question is introduced, why doesn't this take effect? What is the answer before it takes effect? ​​I cannot deploy the test locally or on zeabur online. ps I just pulled the latest code and tested it! [image](https://private-user-images.githubusercontent.com/8509438/304149940-157b18b5-b3d0-431e-91b8-d3c03a961a56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVC J9. .C7NrSxkgo_qC5htsn3OstKyB13t6sFy_QFFKtanmUIA)

This may be caused by network problems and has nothing to do with turning on and off several plug-ins.

Hk-Gosuto commented 5 months ago

我怀疑是你使用的模型的问题,你直接用上面的 prompt 来测试一下模型的返回看看吧。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


I suspect it is a problem with the model you are using. Just use the prompt above to test the return of the model.

zpng commented 5 months ago

我怀疑是你使用的模型的问题,你直接用上面的 prompt 来测试一下模型的返回看看吧。

image

直接用你的文本prompt去测试是没有问题的,看起来模型应该没问题吧,另外我其它插件可以用,所以很奇怪为啥pdf的不行

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


I suspect it is a problem with the model you are using. Just use the prompt above to test the return of the model.

image

There is no problem if you directly use your text prompt to test. It seems that the model should be fine. In addition, my other plug-ins can be used, so it is strange why the pdf one cannot.

zpng commented 5 months ago

另外我今天只打开pdf插件又测试了下,这次不说不能访问pdf了,这次访问结果跟第一次一样,返回的驴头不对马嘴的答案。 这个跟我的部署环境有关吗,我是zeabur us-east部署的,或者环境变量配置有关吗,我配置d的环境变量如下图所示。 image

image

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


In addition, I only opened the pdf plug-in and tested it again today. This time, I did not say that I could not access the pdf. The result of this access was the same as the first time, and the answers returned were wrong. Is this related to my deployment environment? I deployed it with zeabur us-east, or is it related to the environment variable configuration? The environment variables I configured d are as shown in the figure below. image

image

Hk-Gosuto commented 5 months ago

你看一下日志,我在最新的代码中把 pdf 插件处理好的 prompt 输出了,搜一下 [pdf-browser] 相关的日志。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Take a look at the logs. I output the prompt processed by the pdf plug-in in the latest code. Search for [pdf-browser] related logs.

zpng commented 5 months ago

你看一下日志,我在最新的代码中把 pdf 插件处理好的 prompt 输出了,搜一下 [pdf-browser] 相关的日志。

在日志中没有搜到[pdf-browser]这个日志,是不是没走到?

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Take a look at the logs. I output the prompt processed by the pdf plug-in in the latest code. Search for [pdf-browser] related logs.

The log [pdf-browser] was not found in the log. Did you miss it?

zpng commented 5 months ago

@Hk-Gosuto 我尝试在本地加了一些log,可以看到卡在了下面标红的地方,pdf come here5打印了,pdf come here6没有打印,辛苦大佬帮忙看下吧~ image image

zpng commented 5 months ago

@Hk-Gosuto 另外我把doc打印出来,发现doc其实是读到了的,所以应该是上面标红的 const vectorStore = await MemoryVectorStore.fromDocuments( docs, this.embeddings, ); 这段代码的问题 image

Hk-Gosuto commented 5 months ago

你没走到的方法是将文档转换为向量的部分,你是不是用的转发服务之类的东西,没启用 openai 向量模型?

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


The method you didn't go to is to convert the document into a vector. Did you use a forwarding service or something like that and didn't enable the openai vector model?

zpng commented 5 months ago

你没走到的方法是将文档转换为向量的部分,你是不是用的转发服务之类的东西,没启用 openai 向量模型?

我是用的转发服务,不过这个openai向量模型要怎么启用啊,需要用官方key才可以吗,不能转发服务吗

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


The method you didn't go to is to convert the document into a vector. Did you use a forwarding service or something like that and didn't enable the openai vector model?

I am using the forwarding service, but how do I enable this openai vector model? Do I need to use the official key? Is it not possible to forward the service?

Hk-Gosuto commented 5 months ago

你没走到的方法是将文档转换为向量的部分,你是不是用的转发服务之类的东西,没启用 openai 向量模型?

我是用的转发服务,不过这个openai向量模型要怎么启用啊,需要用官方key才可以吗,不能转发服务吗

转发也可以,比如如果你用的是 one-api 转发的话,需要将 text-embedding-ada-002 这个嵌入模型加入到渠道的模型中,最好把所有 text 开头的模型都加进来。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


The method you did not go to is to convert the document into a vector. Did you use a forwarding service or something like that and did not enable the openai vector model?

I am using the forwarding service, but how do I enable this openai vector model? Do I need to use the official key? Is it not possible to forward the service?

Forwarding is also possible. For example, if you are using one-api forwarding, you need to add the text-embedding-ada-002 embedding model to the channel model. It is best to add all models starting with text.

zpng commented 5 months ago

https://edu.sse.com.cn/theme/investors/share/c/4726971.pdf

打开text-embedding-ada-002这个的转发可以了,大佬牛逼👍🏻

image