@kapa.ai
rerank = SentenceTransformerRerank(
model="cross-encoder/ms-marco-MiniLM-L-2-v2", top_n=3
)
gives error
AttributeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
1363 try:
-> 1364 return importlib.import_module("." + module_name, self.__name__)
1365 except Exception as e:
18 frames
AttributeError: module 'torch._subclasses' has no attribute 'functional_tensor'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
1364 return importlib.import_module("." + module_name, self.__name__)
1365 except Exception as e:
-> 1366 raise RuntimeError(
1367 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its"
1368 f" traceback):\n{e}"
RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback):
module 'torch._subclasses' has no attribute 'functional_tensor'