Skip to content

Commit 7198b83

Browse files
committed
fix: python 3.9 on linux
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
1 parent b909590 commit 7198b83

File tree

1 file changed

+4
-5
lines changed
  • integrations/fastembed/src/haystack_integrations/components/rankers/fastembed

1 file changed

+4
-5
lines changed

integrations/fastembed/src/haystack_integrations/components/rankers/fastembed/colbert_reranker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ def warm_up(self):
104104
if v is not None:
105105
kwargs[k] = v
106106

107-
try:
108-
self._encoder = LateInteractionTextEmbedding(**kwargs)
109-
except TypeError:
110-
self._encoder = LateInteractionTextEmbedding(model_name=self.model, threads=self.threads)
111-
107+
# Only include keys that are not None
108+
init_kwargs = {k: v for k, v in kwargs.items() if v is not None}
109+
self._encoder = LateInteractionTextEmbedding(**init_kwargs)
110+
112111
gen_q = self._encoder.query_embed(["warmup"])
113112
next(gen_q, None)
114113
gen_d = self._encoder.embed(["warmup"])

0 commit comments

Comments
 (0)