model fix + env var

This commit is contained in:
Alex 2023-05-25 19:33:37 +01:00
parent 0b78480977
commit aaa1249a41
3 changed files with 3 additions and 2 deletions

View File

@ -197,8 +197,7 @@ def api_answer():
elif settings.LLM_NAME == "cohere":
llm = Cohere(model="command-xlarge-nightly", cohere_api_key=api_key)
elif settings.LLM_NAME == "gpt4all":
llm = GPT4All(model="/Users/alextu/Library/Application Support/nomic.ai/GPT4All/",
backend='gpt4all-j-v1.3-groovy')
llm = GPT4All(model=settings.MODEL_PATH)
else:
raise ValueError("unknown LLM model")

View File

@ -9,6 +9,7 @@ class Settings(BaseSettings):
CELERY_BROKER_URL: str = "redis://localhost:6379/0"
CELERY_RESULT_BACKEND: str = "redis://localhost:6379/1"
MONGO_URI: str = "mongodb://localhost:27017/docsgpt"
MODEL_PATH: str = "./models/gpt4all-model.bin"
API_URL: str = "http://localhost:5001" # backend url for celery worker

View File

@ -31,6 +31,7 @@ Flask-Cors==3.0.10
frozenlist==1.3.3
geojson==2.5.0
greenlet==2.0.2
gpt4all==0.1.7
hub==3.0.1
huggingface-hub==0.12.1
humbug==0.2.8