diff --git a/example.env b/example.env index a8626f5..5d9b6f1 100644 --- a/example.env +++ b/example.env @@ -1,6 +1,25 @@ +# DIRECTORY SETTINGS # + PERSIST_DIRECTORY=db DOCUMENTS_DIRECTORY=source_documents -LLAMA_EMBEDDINGS_MODEL=models/ggml-model-q4_0.bin + +# LLM MODEL SETTINGS # + +# Your LLM type (GPT4All or LlamaCpp) MODEL_TYPE=GPT4All + +# Absolute path to your llama supported embeddings model. +LLAMA_EMBEDDINGS_MODEL=models/ggml-model-q4_0.bin + +# Absolute path to your GPT4All or LlamaCpp model MODEL_PATH=models/ggml-gpt4all-j-v1.3-groovy.bin -MODEL_N_CTX=1000 \ No newline at end of file + +# Context size for both the vector datbase and the llm seperately in one value +# Double this value if you are getting context size errors +MODEL_N_CTX=1024 +# Temperature range of 0=Logical to 1=Creative +MODEL_TEMP=0.8 + +# Stop based on certain characters or strings. +# \n is for new lines and \t is for tabs. +MODEL_STOP=\n,\t diff --git a/startLLM.py b/startLLM.py index 88c4864..c71dee5 100644 --- a/startLLM.py +++ b/startLLM.py @@ -12,6 +12,8 @@ model_type = os.environ.get('MODEL_TYPE') model_path = os.environ.get('MODEL_PATH') model_n_ctx = os.environ.get('MODEL_N_CTX') +model_temp = os.environ.get('MODEL_TEMP') +model_stop = os.environ.get('MODEL_STOP').split(",") def main(): # Load stored vectorstore @@ -32,7 +34,7 @@ def main(): match model_type: case "LlamaCpp": from langchain.llms import LlamaCpp - llm = LlamaCpp(model_path=local_path, n_ctx=model_n_ctx, callbacks=callbacks, verbose=True) + llm = LlamaCpp(model_path=local_path, n_ctx=model_n_ctx, temperature=model_temp, stop=model_stop, callbacks=callbacks, verbose=True) case "GPT4All": from langchain.llms import GPT4All llm = GPT4All(model=local_path, n_ctx=model_n_ctx, callbacks=callbacks, verbose=True, backend='gptj')