Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors while processing files #1

Open
Janarthananvt07 opened this issue Mar 3, 2024 · 3 comments
Open

Errors while processing files #1

Janarthananvt07 opened this issue Mar 3, 2024 · 3 comments

Comments

@Janarthananvt07
Copy link

Followed your step by creating environment, installed requirement.txt and created .env(without a file name, just the extension).

Ran the command streamlit run app.py

Scenario 1 (Some files were unable to process)

While testing theSubmit and proccess functionality on the local host page, I encountered an issue with processing certain PDF files. Upon attempting to submit and process them, I received the following error.

LangChainDeprecationWarning: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.vectorstores import FAISS`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(

Even after installing langchain-community using the pip install command, I'm still unable to import it.

import langchain-community
  Cell In[2], line 1
    import langchain-community
                    ^
SyntaxError: invalid syntax

Scenario 2 (Some files were able to be processed)

Upon opening the localhost page, I immediately receive a warning regarding the langchain_community module. However, when attempting to submit and process a simple PDF file, there are no errors displayed on the webpage or the terminal. However, when I begin to ask a question, I encounter the following error on the webpage

WhatsApp Image 2024-03-03 at 11 58 00 PM

and in the terminal

/Users/USER/anaconda3/envs/pdfx/lib/python3.10/site-packages/langchain/vectorstores/__init__.py:35: LangChainDeprecationWarning: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.vectorstores import FAISS`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
2024-03-03 23:28:15.008 Uncaught app exception
Traceback (most recent call last):
  File "/Users/USER/anaconda3/envs/pdfx/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
  File "/Users/USER/Python Workings - Personal/Gemini-PDF-Question-Answering-System-main/app.py", line 87, in <module>
    main()
  File "/Users/USER/Python Workings - Personal/Gemini-PDF-Question-Answering-System-main/app.py", line 71, in main
    user_input(user_question)
  File "/Users/USER/Python Workings - Personal/Gemini-PDF-Question-Answering-System-main/app.py", line 54, in user_input
    new_db = FAISS.load_local("faiss_index", embeddings)
  File "/Users/USER/anaconda3/envs/pdfx/lib/python3.10/site-packages/langchain_community/vectorstores/faiss.py", line 1110, in load_local
    index = faiss.read_index(
  File "/Users/USER/anaconda3/envs/pdfx/lib/python3.10/site-packages/faiss/swigfaiss.py", line 10538, in read_index
    return _swigfaiss.read_index(*args)
RuntimeError: Error in faiss::FileIOReader::FileIOReader(const char *) at /Users/runner/work/faiss-wheels/faiss-wheels/faiss/faiss/impl/io.cpp:68: Error: 'f' failed: could not open faiss_index/index.faiss for reading: No such file or directory

Am i following the right steps as mentioned by you?

  • Is the .env file naming convention is right, just the extension without the file name.
  • Are any other packages (versions) or modules to be installed to the environment.
    Can you please help me?
    Thanks.
@Udhaya-kumar24
Copy link

Try to install chromadb

@maxosorios
Copy link

Hi, i've the same error :(

RuntimeError: Error in faiss::FileIOReader::FileIOReader(const char *) at /Users/runner/work/faiss-wheels/faiss-wheels/faiss/faiss/impl/io.cpp:68: Error: 'f' failed: could not open faiss_index/index.faiss for reading: No such file or directory

@frezyn
Copy link

frezyn commented May 20, 2024

this error is referent to version of lib langchain_google_genai. my solution is atribute version what lib is work.
langchain_google_genai==1.0.1

requirements.txt:

streamlit google-generativeai python-dotenv langchain PyPDF2 chromadb faiss-cpu langchain_google_genai==1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants