Skip to content

Commit

Permalink
add additional clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Oct 9, 2024
1 parent 67f33c8 commit 454437f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/danswer/configs/app_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
os.environ.get("CUSTOM_ANSWER_VALIDITY_CONDITIONS", "[]")
)

VESPA_REQUEST_TIMEOUT = int(os.environ.get("VESPA_REQUEST_TIMEOUT") or "0") or None
VESPA_REQUEST_TIMEOUT = int(os.environ.get("VESPA_REQUEST_TIMEOUT") or "5")

SYSTEM_RECURSION_LIMIT = int(os.environ.get("SYSTEM_RECURSION_LIMIT") or "1000")

Expand Down
5 changes: 2 additions & 3 deletions backend/danswer/configs/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
os.environ.get("NORMALIZE_EMBEDDINGS") or "true"
).lower() == "true"

# Only used for OpenAI and VoyageAI
CLIENT_EMBEDDING_TIMEOUT = int(os.environ.get("CLIENT_EMBEDDING_TIMEOUT") or 0) or None

# Only used for OpenAI
OPENAI_EMBEDDING_TIMEOUT = int(os.environ.get("OPENAI_EMBEDDING_TIMEOUT", "600"))

# Old default model settings, which are needed for an automatic easy upgrade
OLD_DEFAULT_DOCUMENT_ENCODER_MODEL = "thenlper/gte-small"
Expand Down
6 changes: 3 additions & 3 deletions backend/model_server/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from vertexai.language_models import TextEmbeddingInput # type: ignore
from vertexai.language_models import TextEmbeddingModel # type: ignore

from danswer.configs.model_configs import CLIENT_EMBEDDING_TIMEOUT
from danswer.configs.model_configs import OPENAI_EMBEDDING_TIMEOUT
from danswer.utils.logger import setup_logger
from model_server.constants import DEFAULT_COHERE_MODEL
from model_server.constants import DEFAULT_OPENAI_MODEL
Expand Down Expand Up @@ -57,11 +57,11 @@ def _initialize_client(
api_key: str, provider: EmbeddingProvider, model: str | None = None
) -> Any:
if provider == EmbeddingProvider.OPENAI:
return openai.OpenAI(api_key=api_key, timeout=CLIENT_EMBEDDING_TIMEOUT)
return openai.OpenAI(api_key=api_key, timeout=OPENAI_EMBEDDING_TIMEOUT)
elif provider == EmbeddingProvider.COHERE:
return CohereClient(api_key=api_key)
elif provider == EmbeddingProvider.VOYAGE:
return voyageai.Client(api_key=api_key, timeout=CLIENT_EMBEDDING_TIMEOUT)
return voyageai.Client(api_key=api_key)
elif provider == EmbeddingProvider.GOOGLE:
credentials = service_account.Credentials.from_service_account_info(
json.loads(api_key)
Expand Down
3 changes: 0 additions & 3 deletions deployment/docker_compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ services:
- DISABLE_RERANK_FOR_STREAMING=${DISABLE_RERANK_FOR_STREAMING:-}
- MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server}
- MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-}
- VESPA_REQUEST_TIMEOUT=${VESPA_REQUEST_TIMEOUT:-}
# We do not recommend changing this value
- SYSTEM_RECURSION_LIMIT=${SYSTEM_RECURSION_LIMIT:-}
# Leave this on pretty please? Nothing sensitive is collected!
# https://docs.danswer.dev/more/telemetry
- DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-}
Expand Down

0 comments on commit 454437f

Please sign in to comment.