private-gpt
private-gpt copied to clipboard
Can't run ingest any more: none is not an allowed value (type=type_error.none.not_allowed)
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
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
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.
I have deleted the db/ and using the new .env file configuration the ingest is working again.
Thank you!
For those coming to issue, this is what worked for me (python noob here 😅)
cp example.env .envrm -rf dbpython3 ingest.py
Hope this helps 🙌🏻
I can't seem to find the example.env in the first place... nor can I find ingest.py