mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 07:40:12 +01:00
Better error message if .env is empty/does not exist.
This commit is contained in:
parent
b1057afdf8
commit
28537b6a84
3 changed files with 11 additions and 6 deletions
|
|
@ -24,12 +24,13 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|||
from langchain.vectorstores import Chroma
|
||||
from langchain.embeddings import HuggingFaceEmbeddings
|
||||
from langchain.docstore.document import Document
|
||||
|
||||
if not load_dotenv():
|
||||
print("Could not load .env file or it is empty. Please check if it exists and is readable.")
|
||||
exit(1)
|
||||
|
||||
from constants import CHROMA_SETTINGS
|
||||
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
# Load environment variables
|
||||
persist_directory = os.environ.get('PERSIST_DIRECTORY')
|
||||
source_directory = os.environ.get('SOURCE_DIRECTORY', 'source_documents')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue