Skip to content

Commit cb0b3e7

Browse files
Embedder rework (#102)
* chore: update submodules * deprecate: python embedders * deprecate: python embedder * fix: deprecate python embeddings * chore: update submodules * chore: update submodules
1 parent 2e3f9d2 commit cb0b3e7

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed

neural_search/similarity_threshold.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ def get_scores(
7070
List[float]: containing the pairwise distances
7171
"""
7272
embedding_item = embedding.get(project_id, embedding_id)
73-
if (
74-
embedding_item.platform == EmbeddingPlatform.PYTHON.value
75-
and embedding_item.model == "tf-idf"
76-
):
77-
# tf idf embeddings are very similar by default as usually the vectors have a lot of 0s and only very few filled values => threshold doesn't make sense
78-
return [NO_THRESHOLD_INDICATOR]
7973
record_ids = embedding.get_record_ids_by_embedding_id(embedding_id)
8074
distance = util.get_distance_key(
8175
embedding_item.platform, embedding_item.model, False

neural_search/util.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,6 @@ def recreate_collection(project_id: str, embedding_id: str) -> int:
231231
)
232232
records = None
233233

234-
if (
235-
embedding.get(project_id, embedding_id).platform
236-
== EmbeddingPlatform.PYTHON.value
237-
):
238-
embeddings = [[float(e) for e in embedding] for embedding in embeddings]
239-
240234
# extend payloads
241235
label_payload_extension = record_label_association.get_label_payload_for_qdrant(
242236
project_id
@@ -500,11 +494,6 @@ def __qdrant_collection_exits(collection_name: str) -> bool:
500494
def get_distance_key(
501495
platform: str, model: str, for_qdrant: bool = True
502496
) -> Union[str, models.Distance]:
503-
if platform == EmbeddingPlatform.PYTHON.value and model == "tf-idf":
504-
if for_qdrant:
505-
return models.Distance.COSINE
506-
else:
507-
return "cosine"
508497
if for_qdrant:
509498
return models.Distance.EUCLID
510499
else:

submodules/model

0 commit comments

Comments
 (0)