private-gpt: 1 validation error for GPT4All

Any idea of this error? Couldn’t really find an answer

Traceback (most recent call last):
  File "/privateGPT/privateGPT.py", line 76, in <module>
    main()
  File "/privateGPT/privateGPT.py", line 36, in main
    llm = GPT4All(model=model_path, n_ctx=model_n_ctx, backend='gptj', callbacks=callbacks, verbose=False)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for GPT4All
__root__
  Invalid model directory (type=value_error)```

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 32

Most upvoted comments

It appears that the Bin file was designed for an earlier iteration of GPT-4-All and is not compatible with the more recent version. Solution: pip show gpt4all pip uninstall gpt4all pip show gpt4all pip install gpt4all==0.2.3 If you come across this error with other models, consider attempting to downgrade the module you are currently utilizing.

It looks like an issue because of the model directory specified by the model_path variable.

MODEL_PATH=models/ggml-gpt4all-j-v1.3-groovy.bin

The above is located in the .env file and your model location should be the same unless you want to change it. The easiest way is to create a models folder in the Private GPT folder and store your models there.

Hi All,

Once model path correctly mentioned in .env file and remove the extra argument(as per API) n_ctx=1000, Its working as expected.

Hi all,

got the same error. it’s indeed the wrong path. I’m using Google Colab so first I set this path wrongly:

then I used this and it fixed the issue: /content/ggml-gpt4all-j-v1.3-groovy.bin (just copy paste the path file from your IDE file explorer)

after fixing this issue now I can see that the file found: Found model file at /content/models/ggml-gpt4all-j-v1.3-groovy.bin

llm = GPT4All(model=model_path, n_ctx=1000, backend=“gptj”, verbose=False)

then new validation error so i figure the API changed and n_ctx=1000 is invalid - i just removed it and it working.

@constyn @RuddiRodriguez

Thanks Rj1318. This did the trick for on my intel mac: Solution: pip show gpt4all pip uninstall gpt4all pip show gpt4all pip install gpt4all==0.2.3

I did some investigation for this problem and commented in GPT4All: https://github.com/nomic-ai/gpt4all/issues/866#issuecomment-1669620414

My problems is that my CPU does not support AVX, it took a day for me to find that.

Please check if CPU support AVX and AVX2, otherwise nothing will work 😄

for me it didn’t fix the issue? I have changed the MODEL_PATH to this MODEL_PATH=models/ggml-gpt4all-j-v1.3-groovy.bin and I have created a models folder and put the file "ggml-gpt4all-j-v1.3-groovy.bin " in. any ideas why?

UPDATE: I have no clue why, but when I run this on the terminal of vs code, it works if I press crtl + f5, but not when I use the start button on the top right of the screen. I think it has something to do with debug mode and normal execution?