Skip to content

Commit

Permalink
Merge branch 'main' into providers-voyage
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHend authored Nov 1, 2024
2 parents 8d563d2 + 78fb934 commit 8b67830
Show file tree
Hide file tree
Showing 4 changed files with 275 additions and 257 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ make run

Once the above command is run, you will be brought into Postgres via `psql`.

Run the following command inside the `psql` console to enable the extensions:

```sql
create extension vectorize cascade
```

To list out the enabled extensions, run:

```sql
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ All Embedding model and LLM providers can have their base URLs changed.
For example, if you have an OpenAI compliant embedding or LLM server (such as [vLLM](https://github.com/vllm-project/vllm)), running at `https://api.myserver.com/v1`, you can change the base URL with the following SQL command:

```sql
ALTER SYSTEM SET vectorize.openai_base_url TO 'https://api.myserver.com/v1';
ALTER SYSTEM SET vectorize.openai_service_url TO 'https://api.myserver.com/v1';
SELECT pg_reload_conf();
```

Expand Down
11 changes: 10 additions & 1 deletion vector-serve/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

from app.metrics import ML_MODEL_COUNT

LOCAL_FILES_ONLY = os.getenv("LOCAL_FILES_ONLY", "true").lower() in [
"true",
"1",
"t",
True,
]

_HF_ORG = "sentence-transformers"

MODELS_TO_CACHE = [f"{_HF_ORG}/all-MiniLM-L6-v2"]
Expand All @@ -28,7 +35,9 @@ def parse_header(authorization: str) -> str | None:
def load_model_cache(app: FastAPI) -> dict[str, SentenceTransformer]:
model_cache = {}
for m in MODELS_TO_CACHE:
model_cache[m] = SentenceTransformer(m, cache_folder=cache_dir)
model_cache[m] = SentenceTransformer(
m, cache_folder=cache_dir, local_files_only=LOCAL_FILES_ONLY
)
app.state.model_cache = model_cache


Expand Down
Loading

0 comments on commit 8b67830

Please sign in to comment.