8000 Question about retriever.py , 'DenseRetriever' object has no attribute '_check_pooling_method' · Issue #149 · RUC-NLPIR/FlashRAG · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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

Open
wannanfeng opened this issue Mar 26, 2025 · 1 comment

Comments

@wannanfeng
Copy link
wannanfeng commented Mar 26, 2025

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'

@ignorejjj
Copy link
Member

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.

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

2 participants
0