From 3a6ba730a53c8dacbc0e6c35fe2b4ae55c4a13f5 Mon Sep 17 00:00:00 2001 From: doberst Date: Tue, 26 Dec 2023 10:01:55 -0500 Subject: [PATCH] minor embedding updates --- docker-compose-pgvector.yaml | 18 ++++++++++++++++++ llmware/embeddings.py | 10 ++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 docker-compose-pgvector.yaml diff --git a/docker-compose-pgvector.yaml b/docker-compose-pgvector.yaml new file mode 100644 index 00000000..76eaa9a2 --- /dev/null +++ b/docker-compose-pgvector.yaml @@ -0,0 +1,18 @@ + +version: '3.5' + +services: + db: + hostname: db + image: ankane/pgvector + ports: + - 5432:5432 + restart: always + environment: + - POSTGRES_DB=postgres + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD="" + - POSTGRES_HOST_AUTH_METHOD=trust + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + diff --git a/llmware/embeddings.py b/llmware/embeddings.py index 454d86dc..3ca8ef2f 100644 --- a/llmware/embeddings.py +++ b/llmware/embeddings.py @@ -1359,11 +1359,13 @@ def __init__(self, library, model=None, model_name=None, embedding_dims=None, fu # Connect to postgres postgres_host = os.environ.get("USER_MANAGED_PG_HOST","localhost") postgres_port = os.environ.get("USER_MANAGED_PG_PORT", 5432) - postgres_db_name = os.environ.get("USER_MANAGED_PG_DB_NAME", self.library.account_name) - postgres_user_name = os.environ.get("USER_MANAGED_PG_USER_NAME") + postgres_db_name = os.environ.get("USER_MANAGED_PG_DB_NAME", "postgres") + postgres_user_name = os.environ.get("USER_MANAGED_PG_USER_NAME", "postgres") # postgres_full_schema = os.environ.get("USER_MANAGED_PG_FULL_SCHEMA", full_schema) - postgres_pw = "" - + + # default is no password unless user sets in os environ variable + postgres_pw = os.environ.get("USER_MANAGED_PG_PW", "") + # determines whether to use 'skinny' schema or 'full' schema # --note: in future releases, we will be building out more support for PostGres self.full_schema = full_schema