PromtEngineer / localGPT

Chat with your documents on your local device using GPT models. No data leaves your device and 100% private.
Apache License 2.0
20.13k stars 2.25k forks source link

I am using mac os and getting this error despite having source documents in the folder #260

Open Sherlock2111 opened 1 year ago

Sherlock2111 commented 1 year ago

The directory does not exist Traceback (most recent call last): File "/Users/user01/localGPT/run_localGPT_API.py", line 53, in raise FileNotFoundError( FileNotFoundError: No files were found inside SOURCE_DOCUMENTS, please put a starter file inside before starting the API!

Sherlock2111 commented 1 year ago

@PromtEngineer please look into this and reply ASAP

Sherlock2111 commented 1 year ago

@PromtEngineer

conacts commented 1 year ago

My solution can be found here. The issue was caused by not having a cuda device and cuda being default @Sherlock2111.

Sherlock2111 commented 1 year ago

still not solved

conacts commented 1 year ago

@Sherlock2111 can you elaborate on your issue?

Sherlock2111 commented 1 year ago

I am trying to run UI I did all the steps but it doesn’t run this the error I got FileNotFoundError: No files were found inside SOURCE_DOCUMENTS, please put a starter file inside before starting the API!

Sherlock2111 commented 1 year ago

where as I have put my files in the source folder already and code runs on cpu efficiently

Sherlock2111 commented 1 year ago

please help

conacts commented 1 year ago

So if we look at the code, we notice the error you see is caused by

run_langest_commands = ["python", "ingest.py"]
...
result = subprocess.run(run_langest_commands, capture_output=True)
if result.returncode != 0:
    raise FileNotFoundError(
        "No files were found inside SOURCE_DOCUMENTS, please put a starter file inside before starting the API!"
    )

This means the issue lies in executing the ingest.py file.

My issues (being on an M1 mac similar to you) came from cuda being the default. This caused the ingest.py program to exit with an error code. Although the error raised mentions the files in the SOURCE_DOCUMENTS folder, this is not a true representation of the error.

davetwchiu commented 1 year ago

Whenever I run "run_localGPT_API.py", the DB folder will mysteriously disappear.

Sherlock2111 commented 1 year ago

@conacts so what is the solution?

conacts commented 1 year ago

@Sherlock2111 @davetwchiu I am going to need more information to help solve the problem. For example, send me an example of you having the folder with the .parquet files from the given example. Also send the actual error of the output. This is what my current directory looks like:

[cs@zsh] ~/junction/localGPT$ tree -L 2
.
├── ACKNOWLEDGEMENT.md
├── CONTRIBUTING.md
├── DB
│   ├── chroma-collections.parquet
│   └── chroma-embeddings.parquet
├── LICENSE
├── README.md
├── SOURCE_DOCUMENTS
│   └── constitution.pdf
├── __pycache__
│   └── constants.cpython-311.pyc
├── constants.py
├── ingest.py
├── localGPT
│   ├── bin
│   ├── lib
│   ├── pyvenv.cfg
│   └── share
├── localGPTUI
│   ├── localGPTUI.py
│   ├── static
│   └── templates
├── pyproject.toml
├── requirements.txt
├── run_localGPT.py
└── run_localGPT_API.py

Now could you run the tree -L 2 command before and after running python run_localGPT_API.py and send me the results.

Also, are you able to get the prompt to put in a question? This is what mine looks like:

...
AVX = 0 | AVX2 = 0 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | FMA = 0 | NEON = 1 | ARM_FMA = 1 | F16C = 0 | FP16_VA = 1 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 0 | VSX = 0 |

Enter a query:
Sherlock2111 commented 1 year ago

File "/Users/user01/Library/Python/3.9/lib/python/site-packages/auto_gptq/nn_modules/qlinear/qlinear_cuda_old.py", line 83, in init self.autogptq_cuda = autogptq_cuda_256 NameError: name 'autogptq_cuda_256' is not defined

this the new error I'm getting

Sherlock2111 commented 1 year ago
Screenshot 2023-07-29 at 1 13 13 PM
theworkerant commented 1 year ago

@Sherlock2111 These scripts are a bit of mess in the current state of the repo (new exciting things are happening too fast I think). It seems the API script tries to re-run the ingest.py and blows away your DB in the mean time. I commented out the whole section about starting with if os.path.exists(PERSIST_DIRECTORY) all the way through line you see the SOURCE_DOCUMENTS error on (before # load the vectorstore)

My API at least runs at this point (still working on the UI...)