From e7e11b2a66d8ad5869badcf8b5b6febc8399e714 Mon Sep 17 00:00:00 2001 From: Davidyz Date: Wed, 2 Apr 2025 13:41:01 +0800 Subject: [PATCH] fix(cli): explicitly convert query and chunks to `str`. Fix #52 --- src/vectorcode/subcommands/query/reranker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vectorcode/subcommands/query/reranker.py b/src/vectorcode/subcommands/query/reranker.py index 335ff3f2..a9713809 100644 --- a/src/vectorcode/subcommands/query/reranker.py +++ b/src/vectorcode/subcommands/query/reranker.py @@ -71,7 +71,9 @@ def rerank(self, results: QueryResult) -> list[str]: chunk_metas = results["metadatas"][query_chunk_idx] chunk_docs = results["documents"][query_chunk_idx] ranks = self.model.rank( - self.query_chunks[query_chunk_idx], chunk_docs, apply_softmax=True + str(self.query_chunks[query_chunk_idx]), + list(str(i) for i in chunk_docs), + apply_softmax=True, ) for rank in ranks: if QueryInclude.chunk in self.configs.include: