Find answers from the community

Updated 3 months ago

I'm upgrading my llama index version

I'm upgrading my llama index version from 0.9.32 to 0.10.7, after that I found my python project has a runtime error:


Plain Text
from app.routers.qa import qa_router
../routers/qa.py:8: in <module>
    from app.llama_index_server import index_server
../llama_index_server/index_server.py:4: in <module>
    from llama_index.core.indices.postprocessor import SimilarityPostprocessor
../../env/lib/python3.9/site-packages/llama_index/core/indices/postprocessor.py:2: in <module>
    from llama_index.core.postprocessor import (
E   ImportError: cannot import name 'CohereRerank' from 'llama_index.core.postprocessor' (/Users/pengxiao/Documents/github/llama-index-fastapi/env/lib/python3.9/site-packages/llama_index/core/postprocessor/__init__.py)
collected 0 items / 1 error


here qa.py and index_server.py are my own python files, but the error comes from llama_index/core/indices/postprocessor.py. can anyone tell me what should I do? thanks in advance!
a
L
3 comments
issue resolved. I changed the import from from llama_index.indices.postprocessor import SimilarityPostprocessor to from llama_index.core.postprocessor import SimilarityPostprocessor
If you run into anything else, the migration guide may be helpful πŸ™‚ https://discord.com/channels/1059199217496772688/1073670729054294197/1207845501660168232
It s a bit of a change in terms of imports
Add a reply
Sign up and join the conversation on Discord