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

fail to ingest error.

Open Huowuge opened this issue 2 years ago • 10 comments

Had following the instruction. Created the pinecone index and named it, use 1536 dimensions, cosine. However, when I run command: nvm run ingest, it still occurs error as below: `[WARN] Importing from 'langchain/document_loaders' is deprecated. Import from eg. 'langchain/document_loaders/fs/text' or 'langchain/document_loaders/web/cheerio' instead. See https://js.langchain.com/docs/getting-started/install#updating-from-0052 for upgrade instructions. .... .... url: 'https://api.openai.com/v1/embeddings' }, code: 'ERR_NETWORK', request: Request { [Symbol(realm)]: { settingsObject: [Object] }, [Symbol(state)]: { method: 'POST', localURLsOnly: false, unsafeRequest: false, body: [Object], client: [Object], reservedClient: null, replacesClientId: '', window: 'client', keepalive: false, serviceWorkers: 'all', initiator: '', destination: '', priority: null, origin: 'client', policyContainer: 'client', referrer: 'client', referrerPolicy: '', mode: 'cors', useCORSPreflightFlag: false, credentials: 'same-origin', useCredentials: false, cache: 'default', redirect: 'follow', integrity: '', cryptoGraphicsNonceMetadata: '', parserMetadata: '', reloadNavigation: false, historyNavigation: false, userActivation: false, taintedOrigin: false, redirectCount: 0, responseTainting: 'basic', preventNoCacheCacheControlHeaderModification: false, done: false, timingAllowFailed: false, headersList: [HeadersList], urlList: [Array], url: [URL] }, [Symbol(signal)]: AbortSignal { aborted: false }, [Symbol(headers)]: HeadersList { cookies: null, [Symbol(headers map)]: [Map], [Symbol(headers map sorted)]: null } }, response: undefined, isAxiosError: true, toJSON: [Function: toJSON], attemptNumber: 7, retriesLeft: 0 } /Users/Jeff/ChatGPT/gpt4-pdf-chatbot-langchain/scripts/ingest-data.ts:44 throw new Error('Failed to ingest your data'); ^

Error: Failed to ingest your data at run (/Users/Jeff/ChatGPT/gpt4-pdf-chatbot-langchain/scripts/ingest-data.ts:44:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at (/Users/Jeff/ChatGPT/gpt4-pdf-chatbot-langchain/scripts/ingest-data.ts:49:3)`

I have tried to change node to 18.16.0 and the latest version, not work.

Huowuge avatar Apr 14 '23 04:04 Huowuge

Are you using the latest version of this repo?

mayooear avatar Apr 14 '23 12:04 mayooear

Are you using the latest version of this repo?

Yes, the latest yarn version.

Huowuge avatar Apr 14 '23 13:04 Huowuge

Same error here

acrons avatar Apr 14 '23 15:04 acrons

I got the same error too

LorinZhao avatar Apr 15 '23 13:04 LorinZhao

Do you see something like "429 - Too Many Requests" in the stack trace? Might be https://github.com/mayooear/gpt4-pdf-chatbot-langchain/issues/42. Try setting up a payment method and creating a new api key.

wpp avatar Apr 15 '23 14:04 wpp

Do you see something like "429 - Too Many Requests" in the stack trace? Might be #42. Try setting up a payment method and creating a new api key.

Have not tried trace that, however I'm a paying user of openai.

Huowuge avatar Apr 16 '23 03:04 Huowuge

got the same error too

node -v 18.16, latest repo

Kevjinx avatar Apr 16 '23 20:04 Kevjinx

@Huowuge, ENOTDIR error means that the filepath is looking for a directory, not a path to a file.

Shoutout to tuantranf for posting about this: https://github.com/mayooear/gpt4-pdf-chatbot-langchain/issues/162

I replaced my ingest-data.ts with his, updated the filepath to 'docs/' and load up some pdfs to ingest.

Kevjinx avatar Apr 16 '23 20:04 Kevjinx

@Kevjinx, there is no @tuantranf comments in issue #162. Can you please describe in detail how where do you find his ingest-data.ts and how you updated the filepath?

P.S. I'm a noob in programming...

Doggson23 avatar Apr 20 '23 16:04 Doggson23

@Kevjinx, there is no @tuantranf comments in issue #162. Can you please describe in detail how where do you find his ingest-data.ts and how you updated the filepath?

P.S. I'm a noob in programming...

@Doggson23 , are you able to figure this out? I ran into the exact same issue. Please suggest.

jasredyy5 avatar Apr 30 '23 17:04 jasredyy5

I am having the same issue as well. I am not sure @Kevjinx is referring to the correct issue? @mayooear can you help please? I am uploading a single page pdf which I converted to text and back to pdf so it should be ok. I am running Node.js v20.0.0. I am also running ChatGPT v3.5 Turbo and I left it as such in makechain.ts.

LeroyZanzibar avatar May 02 '23 14:05 LeroyZanzibar

I am having the same issue as well. I am not sure @Kevjinx is referring to the correct issue? @mayooear can you help please? I am uploading a single page pdf which I converted to text and back to pdf so it should be ok. I am running Node.js v20.0.0. I am also running ChatGPT v3.5 Turbo and I left it as such in makechain.ts.

Hi @LeroyZanzibar, try just giving the directory name without the pdf filename and it should work.

/* Name of directory to retrieve your files from */ const filePath = 'docs/';

let me know if it works.

jasredyy5 avatar May 02 '23 14:05 jasredyy5

Actually the solution that worked for me was creating a brand new OpenAI account with a different email and generating a new API key. Obviously, not ideal if the first account has access to the GPT4 API but I do not yet so it wasn't too inconvenient for me.

LeroyZanzibar avatar May 02 '23 20:05 LeroyZanzibar

Not working for me, and have followed all of the suggestions here. Does this stack need to update to the latest api as stated in the warnings?

acshulk avatar May 06 '23 15:05 acshulk

This is what worked for me.

https://github.com/mayooear/gpt4-pdf-chatbot-langchain/issues/318#issuecomment-1557525044

bookofbash avatar May 23 '23 05:05 bookofbash

Hi, @Huowuge! I'm Dosu, and I'm helping the gpt4-pdf-chatbot-langchain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

Based on my understanding, you are experiencing an error while trying to ingest data into a Pinecone index. It seems that you have already tried changing the Node version, but the problem persists. Other users have also reported similar issues, and some have suggested possible solutions such as setting up a payment method and creating a new API key, or replacing the ingest-data.ts file and updating the filepath.

Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the gpt4-pdf-chatbot-langchain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding, and we look forward to hearing from you soon.

dosubot[bot] avatar Sep 23 '23 16:09 dosubot[bot]