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
|
|
@ -9,7 +9,9 @@ import os
|
|||
import argparse
|
||||
import time
|
||||
|
||||
load_dotenv()
|
||||
if not load_dotenv():
|
||||
print("Could not load .env file or it is empty. Please check if it exists and is readable.")
|
||||
exit(1)
|
||||
|
||||
embeddings_model_name = os.environ.get("EMBEDDINGS_MODEL_NAME")
|
||||
persist_directory = os.environ.get('PERSIST_DIRECTORY')
|
||||
|
|
@ -39,7 +41,7 @@ def main():
|
|||
case _default:
|
||||
# raise exception if model_type is not supported
|
||||
raise Exception(f"Model type {model_type} is not supported. Please choose one of the following: LlamaCpp, GPT4All")
|
||||
|
||||
|
||||
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever, return_source_documents= not args.hide_source)
|
||||
# Interactive questions and answers
|
||||
while True:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue