Skip to content

Commit

Permalink
chore: Replace deprecated recreate_collection-method.
Browse files Browse the repository at this point in the history
TASK: IL-511
  • Loading branch information
MerlinKallenbornAA committed May 21, 2024
1 parent 20db23b commit d134787
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,16 @@ def __init__(
self._query_representation, self._document_representation = retriever_type.value
self._distance_metric = distance_metric

self._search_client.recreate_collection(
if self._search_client.collection_exists(collection_name=self._collection_name):
self._search_client.delete_collection(
collection_name=self._collection_name,
)

self._search_client.create_collection(
collection_name=self._collection_name,
vectors_config=VectorParams(size=128, distance=self._distance_metric),
)

self._add_texts_to_memory(documents)

def get_relevant_documents_with_scores(
Expand Down

0 comments on commit d134787

Please sign in to comment.