gpt4-pdf-chatbot-langchain icon indicating copy to clipboard operation
gpt4-pdf-chatbot-langchain copied to clipboard

Unhandled Runtime Error

Open tmzncty opened this issue 2 years ago • 2 comments

When I use chinese to ask him, then I can see this error.

Unhandled Runtime Error

AbortError: The operation was aborted. 
Source

pages\index.tsx (104:17) @ abort

  102 |   }));
  103 |   setLoading(false);
> 104 |   ctrl.abort();
      |       ^
  105 | } else {
  106 |   const data = JSON.parse(event.data);
  107 |   if (data.sourceDocs) {
Unhandled Runtime Error

AbortError: The operation was aborted. 
Call Stack
onVisibilityChange
node_modules\.pnpm\@[email protected]\node_modules\@microsoft\fetch-event-source\lib\esm\fetch.js (25:0)

图片 图片 But the CMD can find the ansower sometimes. 图片

My node's is v18.15.0, npm is v9.5.0, system is Windows Server 2022 Datacenter 21H2 20348.169. I changed makechain.ts' line15-26 into

  `您是一个AI助手,提供有用的建议。您得到了以下长文档的提取部分和一个问题。根据提供的上下文等进行交流式回答。
  您既可以引用下面上下文的超链接,又可以自己思考回答。但是不要编造超链接。
  如果您在下面的上下文中找不到答案,请说“嗯,我不确定。”然后请说出自行回答的内容“我的想法是:”。但不要试图编造答案。
  如果问题与上下文无关,请礼貌地回应,您只能回答与上下文有关的问题。您尽可能用中文回答,可以中英对照回答

Question: {question}
=========
{context}
=========
Answer in Markdown:`,
);```
So what can I do to solve the wrong?

tmzncty avatar Mar 23 '23 13:03 tmzncty

Does the app work when the prompt is in english?

mayooear avatar Mar 23 '23 14:03 mayooear

Does the app work when the prompt is in english?

I try the real makechain.ts, but it also tell me error.


AbortError: The operation was aborted. 
Source

pages\index.tsx (104:17) @ abort

  102 |   }));
  103 |   setLoading(false);
> 104 |   ctrl.abort();
      |       ^
  105 | } else {
  106 |   const data = JSON.parse(event.data);
  107 |   if (data.sourceDocs) {

Is it because of my high network latency?

图片

tmzncty avatar Mar 24 '23 00:03 tmzncty

Behind your screenshot, I can see there is output from the stream?

Add a try-catch block around the function.

mayooear avatar Mar 26 '23 03:03 mayooear

Thanks, I find the output in CMD. Then It can run, can ansower. I give up solving this problem. Just ignore its.

tmzncty avatar Mar 28 '23 13:03 tmzncty