ModuleNotFoundError:没有名为“llama_index.postprocessor”的模块

问题描述 投票:0回答:1

我尝试从 llama_index 导入 CohereRerank 模块。但得到了

ModuleNotFoundError: No module named 'llama_index.postprocessor'

python agent huggingface llama-index
1个回答
0
投票

尝试以这种方式导入:

from llama_index.postprocessor.cohere_rerank import CohereRerank

确保您的环境中安装了以下内容

%pip install -q cohere llama-index-postprocessor-cohere-rerank

如果错误仍然存在,请尝试重新安装 llamaindex 并重试,它将起作用。

© www.soinside.com 2019 - 2024. All rights reserved.