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

python ingest.py fails

Open Josh-Reimer opened this issue 1 year ago • 4 comments

When I run python ingest.py it outputs:

Traceback (most recent call last):
  File "C:\Users\Josh\Documents\privateGPT-main\privateGPT-main\ingest.py", line 27, in <module>
    from constants import CHROMA_SETTINGS
  File "C:\Users\Josh\Documents\privateGPT-main\privateGPT-main\constants.py", line 11, in <module>
    CHROMA_SETTINGS = Settings(
  File "pydantic\env_settings.py", line 39, in pydantic.env_settings.BaseSettings.__init__
  File "pydantic\main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Settings
persist_directory
  none is not an allowed value (type=type_error.none.not_allowed)

  • OS / hardware: Windows 10 Acer Switch Alpha 12 intel i5
  • Python version 3.10.11
  • example.env file contents:
PERSIST_DIRECTORY=db
MODEL_TYPE=GPT4All
MODEL_PATH=Downloads\ggml-gpt4all-j-v1.3-groovy.bin
EMBEDDINGS_MODEL_NAME=all-MiniLM-L6-v2
MODEL_N_CTX=1000
TARGET_SOURCE_CHUNKS=4

Josh-Reimer avatar Jun 03 '23 00:06 Josh-Reimer

You need to remove example from example.env so you're left with only .env

tatelax avatar Jun 03 '23 03:06 tatelax

Hi, exactly, after copying "example.env" to ".env", it's working fine. Thanks

drly77 avatar Jun 03 '23 10:06 drly77

After renaming example.env to .env it works

Josh-Reimer avatar Jun 04 '23 12:06 Josh-Reimer

I had this issue too, but I had renamed example.env to .env.

I had to install Visual Studio build tools and pip install chromadb
and then pip install sentence_transformers and then a few others.

I couldn't build the wheels (I think?) because I needed to install the build tools when I ran the requirements.txt. After installing the build tools, I ran pip install -r requirements.txt again, and it had work to do.

jasonvivier avatar Jun 14 '23 15:06 jasonvivier