FlashRAG icon indicating copy to clipboard operation
FlashRAG copied to clipboard

Question about retriever.py , 'DenseRetriever' object has no attribute '_check_pooling_method'

Open wannanfeng opened this issue 9 months ago • 1 comments

It seems that the function self._check_pooling_method is missing in the retriever.py?

And is there a typo issue on line 373 and 389 regarding retrieval_model_path?

Image

(base) root@autodl-container-0b0b4098ff-c0c2ad5c:~/autodl-tmp/FlashRAG/examples/quick_start# python simple_pipeline.py Loading test dataset from: dataset/nq/test.jsonl... Sliding Window Attention is enabled but not implemented for sdpa; unexpected results may be encountered. Generating train split: 15000 examples [00:00, 600627.79 examples/s] Traceback (most recent call last): File "/root/autodl-tmp/FlashRAG/flashrag/utils/utils.py", line 94, in get_retriever return getattr(importlib.import_module("flashrag.retriever"), "DenseRetriever")(config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/FlashRAG/flashrag/retriever/retriever.py", line 348, in init self.load_model() File "/root/autodl-tmp/FlashRAG/flashrag/retriever/retriever.py", line 389, in load_model self._check_pooling_method(self.retrieval_model_path, self.pooling_method) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'DenseRetriever' object has no attribute '_check_pooling_method'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/autodl-tmp/FlashRAG/examples/quick_start/simple_pipeline.py", line 38, in pipeline = SequentialPipeline(config, prompt_template=prompt_templete) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/FlashRAG/flashrag/pipeline/pipeline.py", line 58, in init self.retriever = get_retriever(config) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/FlashRAG/flashrag/utils/utils.py", line 96, in get_retriever return getattr(importlib.import_module("flashrag.retriever"), "DenseRetriever")(config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/FlashRAG/flashrag/retriever/retriever.py", line 348, in init self.load_model() File "/root/autodl-tmp/FlashRAG/flashrag/retriever/retriever.py", line 389, in load_model self._check_pooling_method(self.retrieval_model_path, self.pooling_method) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'DenseRetriever' object has no attribute '_check_pooling_method'

wannanfeng avatar Mar 26 '25 11:03 wannanfeng

Thank you for pointing it out! We have made two modifications to the typo. There may have been some missing parts, but they have been corrected in the previous version. Now you can try pulling the latest code.

ignorejjj avatar Mar 26 '25 12:03 ignorejjj