Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when no paragraph was matched: torch.cat(): expected a non-empty list of Tensors #370

Open
AnywhereSoftware opened this issue Sep 29, 2024 · 0 comments

Comments

@AnywhereSoftware
Copy link

To better understand the behavior of pids, I've added and removed (IndexUpdater.remove) short paragraphs.
It started crashing with one specific query. It looks like it fails when no pid was matched.
Code:

with Run().context(RunConfig(experiment='notebook')):
searcher = Searcher(index=index_name)
results = searcher.search("7", k=4, filter_fn=None)

Error:
File "/home/erel/PycharmProjects/colbert_test/test.py", line 78, in search
results = searcher.search("7", k=4, filter_fn=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/erel/python_env/lib/python3.12/site-packages/colbert/searcher.py", line 67, in search
return self.dense_search(Q, k, filter_fn=filter_fn, pids=pids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/erel/python_env/lib/python3.12/site-packages/colbert/searcher.py", line 129, in dense_search
pids, scores = self.ranker.rank(self.config, Q, filter_fn=filter_fn, pids=pids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/erel/python_env/lib/python3.12/site-packages/colbert/search/index_storage.py", line 104, in rank
scores, pids = self.score_pids(config, Q, pids, centroid_scores)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/erel/python_env/lib/python3.12/site-packages/colbert/search/index_storage.py", line 148, in score_pids
approx_scores = torch.cat(approx_scores, dim=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: torch.cat(): expected a non-empty list of Tensors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant