Find answers from the community

Updated 3 months ago

fixed llama_index.core but

I am working on deep learning ai course. Can anyone help me fix these imports? I think the API is updated now?

Plain Text
from llama_index import ServiceContext, VectorStoreIndex, StorageContext
from llama_index.node_parser import SentenceWindowNodeParser
from llama_index.indices.postprocessor import MetadataReplacementPostProcessor
from llama_index.indices.postprocessor import SentenceTransformerRerank
from llama_index import load_index_from_storage
A
T
4 comments
ModuleNotFoundError: No module named 'llama_index.node_parser'
Are you on the latest version? ServiceContext has been deprecated.

Node parser now would be
Plain Text
from llama_index.core.node_parser


Other ones:
Plain Text
from llama_index.core import VectorStoreIndex, StorageContext, load_index_from_storage



etc. etc.

Here's the migration details: https://docs.llamaindex.ai/en/stable/getting_started/v0_10_0_migration/
I think it's fixed now

Plain Text
from llama_index.core.node_parser import HierarchicalNodeParser

from llama_index.core.node_parser import get_leaf_nodes
from llama_index.core import StorageContext
from llama_index.core.retrievers import AutoMergingRetriever
from llama_index.core.postprocessor import SentenceTransformerRerank
from llama_index.core.query_engine import RetrieverQueryEngine
I changed all from API @Teemu
Add a reply
Sign up and join the conversation on Discord