mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-30 04:31:49 +02:00
Disable Gpt4all due to mac not supporting it currently (#233)
This commit is contained in:
parent
e019db0bc7
commit
273802eff0
@ -35,9 +35,12 @@ BATCH_SIZE_ENCODE_CHUNKS = 8
|
|||||||
# Valid list:
|
# Valid list:
|
||||||
# - openai-completion
|
# - openai-completion
|
||||||
# - openai-chat-completion
|
# - openai-chat-completion
|
||||||
# - gpt4all-completion
|
# - gpt4all-completion -> Due to M1 Macs not having compatible gpt4all version, please install dependency yourself
|
||||||
# - gpt4all-chat-completion
|
# - gpt4all-chat-completion-> Due to M1 Macs not having compatible gpt4all version, please install dependency yourself
|
||||||
INTERNAL_MODEL_VERSION = os.environ.get("INTERNAL_MODEL", "openai-chat-completion")
|
# To use gpt4all, run: pip install --upgrade gpt4all==1.0.5
|
||||||
|
INTERNAL_MODEL_VERSION = os.environ.get(
|
||||||
|
"INTERNAL_MODEL_VERSION", "openai-chat-completion"
|
||||||
|
)
|
||||||
# For GPT4ALL, use "ggml-model-gpt4all-falcon-q4_0.bin" for the below for a tested model
|
# For GPT4ALL, use "ggml-model-gpt4all-falcon-q4_0.bin" for the below for a tested model
|
||||||
GEN_AI_MODEL_VERSION = os.environ.get("GEN_AI_MODEL_VERSION", "gpt-3.5-turbo")
|
GEN_AI_MODEL_VERSION = os.environ.get("GEN_AI_MODEL_VERSION", "gpt-3.5-turbo")
|
||||||
GEN_AI_MAX_OUTPUT_TOKENS = 512
|
GEN_AI_MAX_OUTPUT_TOKENS = 512
|
||||||
|
@ -3,14 +3,16 @@ from typing import Any
|
|||||||
from danswer.configs.app_configs import QA_TIMEOUT
|
from danswer.configs.app_configs import QA_TIMEOUT
|
||||||
from danswer.configs.model_configs import INTERNAL_MODEL_VERSION
|
from danswer.configs.model_configs import INTERNAL_MODEL_VERSION
|
||||||
from danswer.direct_qa.exceptions import UnknownModelError
|
from danswer.direct_qa.exceptions import UnknownModelError
|
||||||
from danswer.direct_qa.gpt_4_all import GPT4AllChatCompletionQA
|
|
||||||
from danswer.direct_qa.gpt_4_all import GPT4AllCompletionQA
|
|
||||||
from danswer.direct_qa.interfaces import QAModel
|
from danswer.direct_qa.interfaces import QAModel
|
||||||
from danswer.direct_qa.open_ai import OpenAIChatCompletionQA
|
from danswer.direct_qa.open_ai import OpenAIChatCompletionQA
|
||||||
from danswer.direct_qa.open_ai import OpenAICompletionQA
|
from danswer.direct_qa.open_ai import OpenAICompletionQA
|
||||||
from openai.error import AuthenticationError
|
from openai.error import AuthenticationError
|
||||||
from openai.error import Timeout
|
from openai.error import Timeout
|
||||||
|
|
||||||
|
# Imports commented out temporarily due to incompatibility of gpt4all with M1 Mac hardware currently
|
||||||
|
# from danswer.direct_qa.gpt_4_all import GPT4AllChatCompletionQA
|
||||||
|
# from danswer.direct_qa.gpt_4_all import GPT4AllCompletionQA
|
||||||
|
|
||||||
|
|
||||||
def check_model_api_key_is_valid(model_api_key: str) -> bool:
|
def check_model_api_key_is_valid(model_api_key: str) -> bool:
|
||||||
if not model_api_key:
|
if not model_api_key:
|
||||||
@ -41,9 +43,10 @@ def get_default_backend_qa_model(
|
|||||||
return OpenAICompletionQA(timeout=timeout, api_key=api_key, **kwargs)
|
return OpenAICompletionQA(timeout=timeout, api_key=api_key, **kwargs)
|
||||||
elif internal_model == "openai-chat-completion":
|
elif internal_model == "openai-chat-completion":
|
||||||
return OpenAIChatCompletionQA(timeout=timeout, api_key=api_key, **kwargs)
|
return OpenAIChatCompletionQA(timeout=timeout, api_key=api_key, **kwargs)
|
||||||
elif internal_model == "gpt4all-completion":
|
# Note GPT4All is not supported for M1 Mac machines currently, removing until support is added
|
||||||
return GPT4AllCompletionQA(**kwargs)
|
# elif internal_model == "gpt4all-completion":
|
||||||
elif internal_model == "gpt4all-chat-completion":
|
# return GPT4AllCompletionQA(**kwargs)
|
||||||
return GPT4AllChatCompletionQA(**kwargs)
|
# elif internal_model == "gpt4all-chat-completion":
|
||||||
|
# return GPT4AllChatCompletionQA(**kwargs)
|
||||||
else:
|
else:
|
||||||
raise UnknownModelError(internal_model)
|
raise UnknownModelError(internal_model)
|
||||||
|
@ -10,7 +10,9 @@ filelock==3.12.0
|
|||||||
google-api-python-client==2.86.0
|
google-api-python-client==2.86.0
|
||||||
google-auth-httplib2==0.1.0
|
google-auth-httplib2==0.1.0
|
||||||
google-auth-oauthlib==1.0.0
|
google-auth-oauthlib==1.0.0
|
||||||
gpt4all==1.0.5
|
# GPT4All library does not support M1 Mac architecture
|
||||||
|
# will reintroduce this when library version catches up
|
||||||
|
# gpt4all==1.0.5
|
||||||
httpcore==0.16.3
|
httpcore==0.16.3
|
||||||
httpx==0.23.3
|
httpx==0.23.3
|
||||||
httpx-oauth==0.11.2
|
httpx-oauth==0.11.2
|
||||||
|
@ -45,6 +45,8 @@ services:
|
|||||||
- vector_db
|
- vector_db
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
|
- INTERNAL_MODEL_VERSION=${INTERNAL_MODEL_VERSION:-openai-chat-completion}
|
||||||
|
- GEN_AI_MODEL_VERSION=${GEN_AI_MODEL_VERSION:-gpt-3.5-turbo}
|
||||||
- POSTGRES_HOST=relational_db
|
- POSTGRES_HOST=relational_db
|
||||||
- QDRANT_HOST=vector_db
|
- QDRANT_HOST=vector_db
|
||||||
- TYPESENSE_HOST=search_engine
|
- TYPESENSE_HOST=search_engine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user