Find answers from the community

Updated 3 months ago

can someone help me with this

can someone help me with this

ModuleNotFoundError: No module named 'llama_index.core.llms.generic_utils'
W
m
9 comments
There is from llama_index.core.llms.utils
Can you show the full import
thank @WhiteFang_Jr here is the full code for import

from llama_index.core import SimpleDirectoryReader, VectorStoreIndex

import os.path
from llama_index.core import (
VectorStoreIndex,
SimpleDirectoryReader,
StorageContext,
load_index_from_storage,
)
from llama_index.llms.llama_cpp import LlamaCPP
from llama_index.llms.llama_cpp.llama_utils import messages_to_prompt, completion_to_prompt

from llama_index.core.llms.llama_utils import messages_to_prompt, completion_to_prompt

I dont see the import which caused the error in the above code
the llama_cpp cause the problem



File ~\anaconda3\envs\python310\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File c:\users\msamwelmollel\documents\takukuru llm\gradiochat.py:16
from llama_index.llms.llama_cpp import LlamaCPP

File ~\anaconda3\envs\python310\lib\site-packages\llama_index\llms\llama_cpp__init__.py:1
from llama_index.llms.llama_cpp.base import LlamaCPP

File ~\anaconda3\envs\python310\lib\site-packages\llama_index\llms\llama_cpp\base.py:22
from llama_index.core.llms.generic_utils import (

ModuleNotFoundError: No module named 'llama_index.core.llms.generic_utils'
try updating llama cpp package: pip install -U llama-index-llms-llama-cpp
works as charm thanks
@WhiteFang_Jr The previous code solved with llama cpp but when I am using openAIGPT 4o I still get the error

I tried to reinstall it many times pip install llama-index-embeddings-openai but the problem still exists
Do this: pip install llama-index-embeddings-openai also upgrade all the packages that you are using. it seems you have some packages with lower versions and some with higher
Add a reply
Sign up and join the conversation on Discord