Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Fix ColBERTv2RetrieverLocal forward method variable scoping bug (#9272)

Varun Chawlab26b237877f9
diff --git a/dspy/dsp/colbertv2.py b/dspy/dsp/colbertv2.py
index 23b77c8eb..9386bc5c5 100644
--- a/dspy/dsp/colbertv2.py
+++ b/dspy/dsp/colbertv2.py
@@ -169,7 +169,7 @@ class ColBERTv2RetrieverLocal:
filtered_pids = kwargs.get("filtered_pids")
assert isinstance(filtered_pids, list) and all(isinstance(pid, int) for pid in filtered_pids), "The filtered pids should be a list of integers"
device = "cuda" if torch.cuda.is_available() else "cpu"
- results = self.searcher.search(
+ searcher_results = self.searcher.search(
query,
# Number of passages to receive
k=k,