Skip to content

Commit

Permalink
Remove empty query prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jncraton committed Apr 21, 2024
1 parent 39a6210 commit 529a8c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 0.20

### Fixed

- Allow missing query prefixes for embedding models

### Added

- Support GIST-small-Embedding-v0 embedding model
Expand Down
4 changes: 0 additions & 4 deletions languagemodels/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ class ModelFilterException(Exception):
{
"name": "all-MiniLM-L6-v2",
"tuning": "embedding",
"query_prefix": "",
"params": 22e6,
"quantization": "int8",
"backend": "ct2",
Expand All @@ -356,7 +355,6 @@ class ModelFilterException(Exception):
{
"name": "gte-tiny",
"tuning": "embedding",
"query_prefix": "",
"params": 22e6,
"quantization": "int8",
"backend": "ct2",
Expand All @@ -366,7 +364,6 @@ class ModelFilterException(Exception):
{
"name": "gte-small",
"tuning": "embedding",
"query_prefix": "",
"params": 33e6,
"quantization": "int8",
"backend": "ct2",
Expand Down Expand Up @@ -395,7 +392,6 @@ class ModelFilterException(Exception):
{
"name": "e5-small-v2",
"tuning": "embedding",
"query_prefix": "",
"params": 33e6,
"quantization": "int8",
"backend": "ct2",
Expand Down
2 changes: 1 addition & 1 deletion languagemodels/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def search(query, docs, count=16):
:return: List of (doc_num, score) tuples sorted by score descending
"""

prefix = get_model_info("embedding")["query_prefix"]
prefix = get_model_info("embedding").get("query_prefix", "")

query_embedding = embed([f"{prefix}{query}"])[0]

Expand Down

0 comments on commit 529a8c7

Please sign in to comment.