private-gpt
private-gpt copied to clipboard
> **~/dev/privateGPT$ python ingest.py**
> **~/dev/privateGPT$ python ingest.py**
Traceback (most recent call last): File "/home/sharan/dev/privateGPT/ingest.py", line 7, in <module> from constants import CHROMA_SETTINGS File "/home/sharan/dev/privateGPT/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)
Originally posted by @omerta222 in https://github.com/imartinez/privateGPT/issues/72#issuecomment-1546522791
Facing same issue
Copy of: https://github.com/imartinez/privateGPT/issues/82 Rename your "example.env" to ".env"
import os from dotenv import load_dotenv from chromadb.config import Settings
load_dotenv()
Retrieve the value of PERSIST_DIRECTORY environment variable
PERSIST_DIRECTORY = os.getenv('PERSIST_DIRECTORY')
Check if PERSIST_DIRECTORY is not None
if PERSIST_DIRECTORY is None: raise ValueError('PERSIST_DIRECTORY environment variable not set')
Define the Chroma settings
CHROMA_SETTINGS = Settings( chroma_db_impl='duckdb+parquet', persist_directory=PERSIST_DIRECTORY, anonymized_telemetry=False )
This code will raise a ValueError exception if the PERSIST_DIRECTORY variable is not set, which helps ensure that the Settings class is not instantiated with an invalid value.
Copy of: #82 Rename your "example.env" to ".env"
I've done this, no luck
consistently hitting
drewcarr@Pro privateGPT % python3 ingest.py
Traceback (most recent call last):
File "/Users/drewcarr/privateGPT/ingest.py", line 24, in <module>
from constants import CHROMA_SETTINGS
File "/Users/drewcarr/privateGPT/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)
no changes in errors, no matter what I change, I only hit this
I get this error
C:\privateGPT-main>python ingest.py
Traceback (most recent call last):
File "C:\privateGPT-main\ingest.py", line 27, in
Copy of: #82 Rename your "example.env" to ".env"
Did you use python 3.10 or later? it is said in GitHub that earlier versions of python won't compile.
I also got the same error, but updated to 3.11 and don't get that error anymore. (Got error with chromadb though, I cannot install it successfully.-> Any idea?)