Skip to content

Errors while processing files #1

Open
@Janarthananvt07

Description

@Janarthananvt07

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions