FlagEmbedding
FlagEmbedding copied to clipboard
ModuleNotFoundError: No module named 'peft' for BAAI/bge-reranker-v2-m3
我从 https://huggingface.co/BAAI/bge-reranker-v2-m3 拷贝粘贴了 第一段代码, 在我的mac m2 机器上跑
from FlagEmbedding import FlagReranker
reranker = FlagReranker('BAAI/bge-reranker-v2-m3', use_fp16=True) # Setting use_fp16 to True speeds up computation with a slight performance degradation
...
碰到错误, 是不是不支持 mac呢?
from FlagEmbedding import FlagReranker
File "/Users/langqiu/anaconda3/lib/python3.11/site-packages/FlagEmbedding/__init__.py", line 3, in <module>
from .flag_reranker import FlagReranker, FlagLLMReranker, LayerWiseFlagLLMReranker
File "/Users/langqiu/anaconda3/lib/python3.11/site-packages/FlagEmbedding/flag_reranker.py", line 9, in <module>
from peft import PeftModel
ModuleNotFoundError: No module named 'peft'
I solved it by running pip install peft . 文档还是写一下这个比较好
I solved it by running
pip install peft. 文档还是写一下这个比较好
已加到setup.py中:https://github.com/FlagOpen/FlagEmbedding/blob/master/setup.py#L28
I also ran into this! Same solution. It is strange why this occurs since it is indeed in setup.py Here is a Colab notebook to demonstrate the bug, https://colab.research.google.com/drive/15dreAVFm9jbYVQDgQEu-nI3ixOPL25Nd?usp=sharing
It can be replicated with just
pip install FlagEmbedding
from FlagEmbedding.FlagEmbedding import FlagICLModel