private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

Can't run ingest any more: none is not an allowed value (type=type_error.none.not_allowed)

Open ibardarov-fms opened this issue 2 years ago • 2 comments
trafficstars

I tried to run ingest in a new python environment but I got the following error.

12:02:11 ∴ ./ingest.py
Traceback (most recent call last):
  File "/home/g/projects/privateGPT/./ingest.py", line 167, in <module>
    main()
  File "/home/g/projects/privateGPT/./ingest.py", line 144, in main
    embeddings = HuggingFaceEmbeddings(model_name=embeddings_model_name)
  File "/home/g/.cache/pypoetry/virtualenvs/privategpt-FaFjlDWE-py3.10/lib/python3.10/site-packages/langchain/embeddings/huggingface.py", line 44, in __init__
    super().__init__(**kwargs)
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for HuggingFaceEmbeddings
model_name
  none is not an allowed value (type=type_error.none.not_allowed)

Environment (please complete the following information): Linux, tried with Python 10, and 11

.env

PERSIST_DIRECTORY=db
LLAMA_EMBEDDINGS_MODEL=/home/g/projects/privateGPT/models/ggml-model-q4_0.bin
MODEL_TYPE=GPT4All
MODEL_PATH=/home/g/projects/privateGPT/models/ggml-gpt4all-j-v1.3-groovy.bin
MODEL_N_CTX=1000

ibardarov-fms avatar May 22 '23 09:05 ibardarov-fms

You are using an old version of this repo, update to the latest version, re install the requirements and recreate your .env. It should look like this:

PERSIST_DIRECTORY=db
MODEL_TYPE=GPT4All
MODEL_PATH=models/ggml-gpt4all-j-v1.3-groovy.bin
EMBEDDINGS_MODEL_NAME=all-MiniLM-L6-v2
MODEL_N_CTX=1000

PulpCattel avatar May 22 '23 09:05 PulpCattel

If you have ingested data a while ago and updated the repository afterward you might have to re-ingest the data, but it got a lot faster so that's less of a problem now.

ManInDark avatar May 22 '23 12:05 ManInDark

I have deleted the db/ and using the new .env file configuration the ingest is working again.

Thank you!

ibardarov-fms avatar May 23 '23 09:05 ibardarov-fms

For those coming to issue, this is what worked for me (python noob here 😅)

  1. cp example.env .env
  2. rm -rf db
  3. python3 ingest.py

Hope this helps 🙌🏻

vjrngn avatar Jun 06 '23 04:06 vjrngn

I can't seem to find the example.env in the first place... nor can I find ingest.py

vtboyarc avatar Nov 16 '23 22:11 vtboyarc