ucl98 / pinecone_ingest_python_implementation

18 stars 3 forks source link

I successfully uploaded the pdf to pinecone according to your guidance, but when I ran it, I reported an error: Failed to initialize Pinecone Client #1

Open Ethan2Perth opened 1 year ago

Ethan2Perth commented 1 year ago

gpt4-langchain-pdf-chatbot@0.1.0 dev next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main.env Error [NextFontError]: Failed to fetch Inter from Google Fonts. at nextFontError (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\utils.js:55:17) at downloadGoogleFonts (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\google\loader.js:87:39) at E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\webpack\loaders\next-font-loader\index.js:52:99 at async Span.traceAsyncFn (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) error - Failed to download Inter from Google Fonts. Using fallback font instead. event - compiled client and server successfully in 15.3s (173 modules) wait - compiling... event - compiled successfully in 3.8s (139 modules) wait - compiling / (client and server)... Error [NextFontError]: Failed to fetch Inter from Google Fonts. at nextFontError (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\utils.js:55:17) at downloadGoogleFonts (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\google\loader.js:87:39) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\webpack\loaders\next-font-loader\index.js:52:93 at async Span.traceAsyncFn (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) error - Failed to download Inter from Google Fonts. Using fallback font instead. event - compiled client and server successfully in 4.6s (1321 modules) Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using

. See https://reactjs.org/link/warning-keys for more information. at Home (webpack-internal:///./pages/index.tsx:29:78) at main at MyApp (webpack-internal:///./pages/_app.tsx:14:18) at StyleRegistry (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\styled-jsx\dist\index\index.js:449:36) at PathnameContextProviderAdapter (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\shared\lib\router\adapters.js:60:11) at AppContainer (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\server\render.js:291:29) at AppContainerWithIsomorphicFiberStructure (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\server\render.js:327:57) at div at Body (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\server\render.js:614:21) wait - compiling /api/chat (client and server)... Error [NextFontError]: Failed to fetch Inter from Google Fonts. at nextFontError (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\utils.js:55:17) at downloadGoogleFonts (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\google\loader.js:87:39) at E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\webpack\loaders\next-font-loader\index.js:52:99 at async Span.traceAsyncFn (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) error - Failed to download Inter from Google Fonts. Using fallback font instead. event - compiled successfully in 75 ms (72 modules) error [ErrorWithoutStackTrace: PineconeClient: Error getting project name: TypeError: fetch failed] wait - compiling /_error (client and server)... error - utils\pinecone-client.ts (19:10) @ initPinecone error - Error: Failed to initialize Pinecone Client at initPinecone (webpack-internal:///(api)/./utils/pinecone-client.ts:22:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async eval (webpack-internal:///(api)/./utils/pinecone-client.ts:25:18) 17 | } catch (error) { 18 | console.log('error', error);

19 | throw new Error('Failed to initialize Pinecone Client'); | ^ 20 | } 21 | } 22 | Error [NextFontError]: Failed to fetch Inter from Google Fonts. at nextFontError (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\utils.js:55:17) at downloadGoogleFonts (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\compiled\@next\font\dist\google\loader.js:87:39) at E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\webpack\loaders\next-font-loader\index.js:52:99 at async Span.traceAsyncFn (E:\autogpt\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) error - Failed to download Inter from Google Fonts. Using fallback font instead. event - compiled client and server successfully in 14.9s (1322 modules)

ucl98 commented 1 year ago

It should not be a problem with my python implementation. It would never stop the start of gpt4-pdf-charbot-langchain project. Both projects are seperated and you should not mix them. To me it looks like an issue with your setup of gpt4-pdf-chatbot-langchain. Check out my detailed walkthrough and see if you spot some issues. Reinstalling the application also can help a lot. https://github.com/ucl98/gpt4_langchain_pdf-detailed-walktrough

Ethan2Perth commented 1 year ago

I re-installed according to your instructions https://github.com/ucl98/gpt4_langchain_pdf-detailed-walktrough, and I can't connect to pinecone as before. Can you help me see what is wrong? Thanks.

PS E:\gpt4-pdf-chatbot-langchain-main_2\gpt4-pdf-chatbot-langchain-main> npm run ingest

gpt4-langchain-pdf-chatbot@0.1.0 ingest tsx -r dotenv/config scripts/ingest-data.ts

[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. error [ErrorWithoutStackTrace: PineconeClient: Error getting project name: TypeError: fetch failed] e:\gpt4-pdf-chatbot-langchain-main_2\gpt4-pdf-chatbot-langchain-main\utils\pinecone-client.ts:19 throw new Error('Failed to initialize Pinecone Client'); ^

Error: Failed to initialize Pinecone Client at initPinecone (e:\gpt4-pdf-chatbot-langchain-main_2\gpt4-pdf-chatbot-langchain-main\utils\pinecone-client.ts:19:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at (e:\gpt4-pdf-chatbot-langchain-main_2\gpt4-pdf-chatbot-langchain-main\utils\pinecone-client.ts:23:25)

Node.js v20.1.0

ucl98 commented 1 year ago

Why dont you use my python code for ingest? It is a seperat project and should not be mix with the original project. You can simply ingest your pdfs with my python code and the sources will appear in the chatbot. You would not have to deal witht he pinecone issues. Nodejs is in general more prone for errors and not so easy to set up. As long as “npm run dev” works, you can start the chatbot.

Ethan2Perth commented 1 year ago

Sorry, I didn't express what I mean clearly. I have successfully run your 'loading.py' yesterday, but I got an error when chatting with the chatbot. This error has been bothering me. I sincerely hope that you can help me solve this problem.

Snipaste_2023-05-06_17-39-14 Snipaste_2023-05-06_17-40-07
ucl98 commented 1 year ago

Glad to see that the vectors could be initialized 😃 There are others with the same problem: https://github.com/mayooear/gpt4-pdf-chatbot-langchain/issues/226. Since the error message doesn't tell much it is hard to determine what went wrong. I cannot help there besides telling you to double check everything.

0rangeAppl3 commented 1 year ago

I also got the same issue image Wonder if anyone know how to solve it

zinxor commented 1 year ago

Running into the same issue as well.

image

On the frontend seeing an error response as: error SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

ucl98 commented 1 year ago

You have an issue with your Pinecone API key.

Error: Unauthorized - API key is missing or invalid

Checkout my walkthrough if you need more help https://github.com/ucl98/gpt4_langchain_pdf-detailed-walktrough.