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

> **~/dev/privateGPT$ python ingest.py**

Open omerta222 opened this issue 1 year ago • 7 comments

          > **~/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

omerta222 avatar May 13 '23 04:05 omerta222

Facing same issue

TrixCoder avatar May 13 '23 06:05 TrixCoder

Copy of: https://github.com/imartinez/privateGPT/issues/82 Rename your "example.env" to ".env"

Ikxi1 avatar May 13 '23 17:05 Ikxi1

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.

vedantRaikar avatar May 13 '23 17:05 vedantRaikar

Copy of: #82 Rename your "example.env" to ".env" Screenshot 2023-05-19 at 3 20 10 PM

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

Blacktothefuture avatar May 19 '23 22:05 Blacktothefuture

I get this error

C:\privateGPT-main>python ingest.py Traceback (most recent call last): File "C:\privateGPT-main\ingest.py", line 27, in from constants import CHROMA_SETTINGS File "C:\privateGPT-main\constants.py", line 11, in 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)

AdamAdamAdam avatar May 21 '23 01:05 AdamAdamAdam

Copy of: #82 Rename your "example.env" to ".env"

Forenxics avatar May 22 '23 05:05 Forenxics

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?)

tuyenttMathOslo avatar May 22 '23 23:05 tuyenttMathOslo